Skip to content

Commit

Permalink
MINOR Fixed hardcoded links from admin/page to admin/pages
Browse files Browse the repository at this point in the history
  • Loading branch information
chillu committed Apr 18, 2012
1 parent 8a72b32 commit 1b3a634
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions javascript/CMSMain.Tree.js
Expand Up @@ -20,7 +20,7 @@
'_class': 'class-' + val.ssclass,
'action': function(obj) {
// TODO Fix hardcoding of link
$('.cms-container').loadPanel('admin/page/add/?ParentID=' + id + '&Type=' + val.ssclass);
$('.cms-container').loadPanel('admin/pages/add/?ParentID=' + id + '&Type=' + val.ssclass);
}
};
}
Expand All @@ -31,7 +31,7 @@
'label': ss.i18n._t('Tree.EditPage'),
'action': function(obj) {
// TODO Fix hardcoding of link
$('.cms-container').loadPanel('admin/page/add/show/' + obj.data('id'));
$('.cms-container').loadPanel('admin/pages/add/show/' + obj.data('id'));
}
}
};
Expand All @@ -41,7 +41,7 @@
'label': ss.i18n._t('Tree.AddSubPage'),
'action': function(obj) {
// TODO Fix hardcoding of link
$('.cms-container').loadPanel('admin/page/add/?ParentID=' + obj.data('id'));
$('.cms-container').loadPanel('admin/pages/add/?ParentID=' + obj.data('id'));
},
'submenu': allowedChildren
};
Expand Down
10 changes: 5 additions & 5 deletions tests/controller/CMSMainTest.php
Expand Up @@ -62,7 +62,7 @@ function testPublish() {
//$this->assertRegexp('/Done: Published 4 pages/', $response->getBody())

/*
$response = Director::test("admin/page/publishitems", array(
$response = Director::test("admin/pages/publishitems", array(
'ID' => ''
'Title' => ''
'action_publish' => 'Save and publish',
Expand Down Expand Up @@ -198,20 +198,20 @@ function testCreationOfTopLevelPage(){

// with insufficient permissions
$cmsUser->logIn();
$this->get('admin/page/add');
$this->get('admin/pages/add');
$response = $this->post(
'admin/page/add/AddForm',
'admin/pages/add/AddForm',
array('ParentID' => '0', 'ClassName' => 'Page', 'Locale' => 'en_US', 'action_doAdd' => 1)
);
// should redirect, which is a permission error
$this->assertEquals(403, $response->getStatusCode(), 'Add TopLevel page must fail for normal user');

// with correct permissions
$rootEditUser->logIn();
$response = $this->get('admin/page/add');
$response = $this->get('admin/pages/add');

$response = $this->post(
'admin/page/add/AddForm',
'admin/pages/add/AddForm',
array('ParentID' => '0', 'ClassName' => 'Page', 'Locale' => 'en_US', 'action_doAdd' => 1)
);

Expand Down
8 changes: 4 additions & 4 deletions tests/controller/CMSPageHistoryControllerTest.php
Expand Up @@ -85,7 +85,7 @@ function testGetEditForm() {
* @todo check highlighting for comparing pages.
*/
function testVersionsForm() {
$history = $this->get('admin/page/history/show/'. $this->page->ID);
$history = $this->get('admin/pages/history/show/'. $this->page->ID);
$form = $this->cssParser()->getBySelector("#Form_VersionsForm");

$this->assertEquals(1, count($form));
Expand All @@ -102,7 +102,7 @@ function testVersionsForm() {
}

function testVersionsFormTableContainsInformation() {
$history = $this->get('admin/page/history/show/'. $this->page->ID);
$history = $this->get('admin/pages/history/show/'. $this->page->ID);
$form = $this->cssParser()->getBySelector("#Form_VersionsForm");
$rows = $form[0]->xpath("fieldset/table/tbody/tr");

Expand All @@ -127,7 +127,7 @@ function testVersionsFormTableContainsInformation() {
}

function testVersionsFormSelectsUnpublishedCheckbox() {
$history = $this->get('admin/page/history/show/'. $this->page->ID);
$history = $this->get('admin/pages/history/show/'. $this->page->ID);
$checkbox = $this->cssParser()->getBySelector("#Form_VersionsForm #ShowUnpublished input");

$this->assertThat($checkbox[0], $this->logicalNot($this->isNull()));
Expand All @@ -136,7 +136,7 @@ function testVersionsFormSelectsUnpublishedCheckbox() {
$this->assertThat($checked, $this->logicalNot($this->stringContains('checked')));

// viewing an unpublished
$history = $this->get('admin/page/history/show/'.$this->page->ID .'/'.$this->versionUnpublishedCheck);
$history = $this->get('admin/pages/history/show/'.$this->page->ID .'/'.$this->versionUnpublishedCheck);
$checkbox = $this->cssParser()->getBySelector("#Form_VersionsForm #ShowUnpublished input");

$this->assertThat($checkbox[0], $this->logicalNot($this->isNull()));
Expand Down
2 changes: 1 addition & 1 deletion tests/search/CMSMainSearchFormTest.php
Expand Up @@ -9,7 +9,7 @@ function testTitleFilter() {
$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));

$response = $this->get(
'admin/page/SearchForm/?' .
'admin/pages/SearchForm/?' .
http_build_query(array(
'Title' => 'Page 10',
'FilterClass' => 'CMSSiteTreeFilter_Search',
Expand Down

0 comments on commit 1b3a634

Please sign in to comment.