ENHANCEMENT: added new PageCommnet to yml so we have different amounts of moderated/unmodereated

BUGFIX: really testing deletemarked now.


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@99679 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Carlos Barberis 2010-02-23 01:57:55 +00:00 committed by Sam Minnee
parent 0a137a4840
commit 9624757e14
2 changed files with 15 additions and 6 deletions

View File

@ -64,6 +64,7 @@ SiteConfig_CreateTopLevelGroups:
GroupID: =>Group.rooteditusers
PageComment:
Comment1:
ID: 8
Name: Person
Comment: Very cool page
NeedsModeration: 1
@ -73,3 +74,8 @@ PageComment:
Comment: I am a person
NeedsModeration: 0
EmailAddress: someone@somewhere.com
Comment3:
Name: Me
Comment: I like this comment
NeedsModeration: 1
EmailAddress: me@test.co.nz

View File

@ -15,7 +15,7 @@ class CommentAdminTest extends FunctionalTest {
$comm = new CommentAdmin();
$resp = $comm->NumUnmoderated();
$this->assertEquals(1, $resp);
$this->assertEquals(2, $resp);
}
function testNumSpam(){
@ -25,11 +25,14 @@ class CommentAdminTest extends FunctionalTest {
$this->assertEquals(0, $resp);
}
function testacceptmarked(){
$id = $this->idFromFixture('PageComment', 'Comment1');
function testdeletemarked(){
$comm = $this->objFromFixture('PageComment', 'Comment1');
$id = $comm->ID;
$this->logInWithPermission('ADMIN');
$result = $this->get('admin/comments/EditForm/field/Comments/item/2/delete');
$this->assertEquals(200, $result->getStatusCode());
$result = $this->get("admin/comments/EditForm/field/Comments/item/$id/delete");
$checkComm = DataObject::get_by_id('PageComment',$id);
$this->assertEquals(0, $checkComm->ID);
}
}