Skip to content

Commit

Permalink
Fixing controller tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed May 15, 2011
1 parent 6713bb1 commit e09f825
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Scaffold.php
Expand Up @@ -125,7 +125,7 @@ function __construct(Controller $controller, CakeRequest $request) {
}

$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;
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Controller/ControllerTest.php
Expand Up @@ -689,7 +689,7 @@ function testComponentBeforeRenderChangingViewClass() {
$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();
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Test/Case/Controller/PagesControllerTest.php
Expand Up @@ -55,10 +55,10 @@ function testDisplay() {
$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');
}
}

0 comments on commit e09f825

Please sign in to comment.