diff options
author | Edmund von der Burg <evdb@mysociety.org> | 2013-09-11 15:24:18 +0100 |
---|---|---|
committer | Edmund von der Burg <evdb@mysociety.org> | 2013-09-11 15:24:18 +0100 |
commit | dec287591b28d4e2eff79f763306168125d6981a (patch) | |
tree | a89dd1cbd0d79b6e59a0a55c2bce1a962d1f62f3 /t/cobrand | |
parent | 35b29430a2c40dc85bcb01e189b8bb4710a5388e (diff) |
[Zurich] create internal note when the category is changed
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/zurich.t | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t index cd826a8d3..a6cf934ef 100644 --- a/t/cobrand/zurich.t +++ b/t/cobrand/zurich.t @@ -1,5 +1,5 @@ # TODO -# Overdue alerts +# Overdue alerts use strict; use warnings; @@ -131,14 +131,14 @@ subtest "changing of categories" => sub { }); } - # put report into know category + # put report into known category my $original_category = $report->category; $report->update({ category => 'Cat1' }); is( $report->category, "Cat1", "Category set to Cat1" ); # get the latest comment my $comments_rs = $report->comments->search({},{ order_by => { -desc => "created" } }); - my $pre_change_comment = $comments_rs->first; + ok ( !$comments_rs->first, "There are no comments yet" ); # change the category via the web interface $mech->get_ok( '/admin/report_edit/' . $report->id ); @@ -148,6 +148,10 @@ subtest "changing of categories" => sub { $report->discard_changes(); is( $report->category, "Cat2", "Category changed to Cat2 as expected" ); + # Check that a new comment has been created. + my $new_comment = $comments_rs->first(); + is( $new_comment->text, "Weitergeleitet von Cat1 an Cat2", "category change comment created" ); + # restore report to original state. $report->update({category => $original_category }); }; |