mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Added test for new permission code.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97897 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b1c407e53e
commit
7adcc967ae
@ -12,6 +12,7 @@ class ContentControllerTest extends FunctionalTest {
|
||||
/**
|
||||
* Test that nested pages, basic actions, and nested/non-nested URL switching works properly
|
||||
*/
|
||||
|
||||
public function testNestedPages() {
|
||||
RootURLController::reset();
|
||||
SiteTree::enable_nested_urls();
|
||||
@ -89,6 +90,20 @@ class ContentControllerTest extends FunctionalTest {
|
||||
SiteTree::disable_nested_urls();
|
||||
}
|
||||
|
||||
public function testViewDraft(){
|
||||
|
||||
// test when user does not have permission, should get login form
|
||||
$this->logInWithPermssion('editor');
|
||||
$this->assertEquals('403', $this->get('/contact/?stage=Stage')->getstatusCode());
|
||||
|
||||
|
||||
// test when user does have permission, should show page title and header ok.
|
||||
$this->logInWithPermssion('admin');
|
||||
$this->assertEquals('200', $this->get('/contact/?stage=Stage')->getstatusCode());
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ContentControllerTest_Page extends Page { }
|
||||
|
Loading…
x
Reference in New Issue
Block a user