Fixing controller tests

This commit is contained in:
Jose Lorenzo Rodriguez 2011-05-15 00:14:41 -04:30
parent 6713bb154e
commit e09f825f8b
3 changed files with 6 additions and 6 deletions

View file

@ -125,7 +125,7 @@ class Scaffold {
}
$this->ScaffoldModel = $this->controller->{$this->modelClass};
$this->scaffoldTitle = Inflector::humanize($this->viewPath);
$this->scaffoldTitle = Inflector::humanize(Inflector::underscore($this->viewPath));
$this->scaffoldActions = $controller->scaffold;
$title_for_layout = __d('cake', 'Scaffold :: ') . Inflector::humanize($request->action) . ' :: ' . $this->scaffoldTitle;
$modelClass = $this->controller->modelClass;

View file

@ -689,7 +689,7 @@ class ControllerTest extends CakeTestCase {
$Controller->constructClasses();
$Controller->Test->viewclass = 'Theme';
$Controller->viewPath = 'posts';
$Controller->theme = 'test_theme';
$Controller->theme = 'TestTheme';
$result = $Controller->render('index');
$this->assertPattern('/default test_theme layout/', $result);
App::build();

View file

@ -55,10 +55,10 @@ class PagesControllerTest extends CakeTestCase {
$this->assertPattern('/posts index/', $Pages->getResponse()->body());
$this->assertEqual($Pages->viewVars['page'], 'index');
$Pages->viewPath = 'themed';
$Pages->display('test_theme', 'posts', 'index');
$Pages->viewPath = 'Themed';
$Pages->display('TestTheme', 'Posts', 'index');
$this->assertPattern('/posts index themed view/', $Pages->getResponse()->body());
$this->assertEqual($Pages->viewVars['page'], 'test_theme');
$this->assertEqual($Pages->viewVars['subpage'], 'posts');
$this->assertEqual($Pages->viewVars['page'], 'TestTheme');
$this->assertEqual($Pages->viewVars['subpage'], 'Posts');
}
}