aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/contact.t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-08-16 10:38:49 +0100
committerStruan Donald <struan@exo.org.uk>2011-08-16 10:38:49 +0100
commitc104ae8c1d72eb25ba60686b58f01da148dc081f (patch)
tree83bbf971b4d4ca305452bdfaacf50cd30ae5317c /t/app/controller/contact.t
parent213948dcc9c281b1873da98e381b25231c376165 (diff)
parentf6ddc9d4db2e272d725e7ed44fb4d828d99d3b61 (diff)
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into open311-consumer
Conflicts: db/schema.sql perllib/FixMyStreet/DB/Result/Problem.pm
Diffstat (limited to 't/app/controller/contact.t')
-rw-r--r--t/app/controller/contact.t11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/app/controller/contact.t b/t/app/controller/contact.t
index bbb3a0f83..86b845eb3 100644
--- a/t/app/controller/contact.t
+++ b/t/app/controller/contact.t
@@ -248,6 +248,9 @@ for my $test (
)
{
subtest 'check email sent correctly' => sub {
+ $problem_main->discard_changes;
+ ok !$problem_main->flagged, 'problem not flagged';
+
$mech->clear_emails_ok;
if ($test->{fields}{id}) {
$mech->get_ok('/contact?id=' . $test->{fields}{id});
@@ -267,6 +270,14 @@ for my $test (
my $problem_id = $test->{fields}{id};
like $email->body, qr/Complaint about report $problem_id/, 'reporting a report'
if $test->{fields}{id};
+
+ $problem_main->discard_changes;
+ if ( $problem_id ) {
+ ok $problem_main->flagged, 'problem flagged';
+ } else {
+ ok !$problem_main->flagged, 'problem not flagged';
+ }
+
};
}