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

BUGFIX: really testing deletemarked now. (from r99679)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@111614 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-04 05:42:32 +00:00
parent d98563e80d
commit 4a613c0e02
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
@ -72,4 +73,9 @@ PageComment:
Name: Someone
Comment: I am a person
NeedsModeration: 0
EmailAddress: someone@somewhere.com
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);
}
}