diff options
author | Struan Donald <struan@exo.org.uk> | 2011-07-26 16:57:08 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-07-26 16:57:08 +0100 |
commit | 54066cd1387643dd6c6cb3040c520bee66881fd7 (patch) | |
tree | eda84b3f347220ed12de3aa690116148287891bd /t/app/controller/alert_new.t | |
parent | 8146bad18eeaab658871dd28eb38199a5d068395 (diff) | |
parent | 198fcef62892fe0b2fbb3ea8a080fca87843445e (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into new_statuses
Conflicts:
perllib/FixMyStreet/App/Controller/Admin.pm
perllib/FixMyStreet/App/Controller/JSON.pm
perllib/FixMyStreet/Map/Tilma/Original.pm
web/css/core.css
Diffstat (limited to 't/app/controller/alert_new.t')
-rw-r--r-- | t/app/controller/alert_new.t | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/app/controller/alert_new.t b/t/app/controller/alert_new.t index cb3b4b656..580a5ad9a 100644 --- a/t/app/controller/alert_new.t +++ b/t/app/controller/alert_new.t @@ -431,6 +431,19 @@ subtest "Test normal alert signups and that alerts are sent" => sub { my $update_id = $update->id; ok $update, "created test update - $update_id"; + $update = FixMyStreet::App->model('DB::Comment')->create( { + problem_id => $report_id, + user_id => $user2->id, + name => 'Anonymous User', + mark_fixed => 'false', + text => 'This is some more update text', + state => 'confirmed', + confirmed => $dt->clone->add( hours => 8 ), + anonymous => 't', + } ); + $update_id = $update->id; + ok $update, "created test update - $update_id"; + FixMyStreet::App->model('DB::AlertType')->email_alerts(); $mech->email_count_is(3); my @emails = $mech->get_email; @@ -442,6 +455,10 @@ subtest "Test normal alert signups and that alerts are sent" => sub { } is $count, 3, 'Three emails with the right things in them'; + my $email = $emails[0]; + like $email->body, qr/Other User/, 'Update name given'; + unlike $email->body, qr/Anonymous User/, 'Update name not given'; + my ( $url, $url_token ) = $emails[0]->body =~ m{http://\S+(/A/(\S+))}; $mech->get_ok( $url ); $mech->content_contains('successfully deleted'); |