diff options
author | Matthew Somerville <matthew@mysociety.org> | 2014-02-24 15:47:06 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2014-02-24 15:47:06 +0000 |
commit | cebc2d4fe88228a9864e737c9cdbdf94629f1554 (patch) | |
tree | 4584a0ad6cd3a04bca36e4a2e6e6090d57f7ea26 | |
parent | 131d182ad218ba9cf733277b0ff2c5efb6a48dc5 (diff) |
Make alert_type.t test more robust.
Put alerts in default cobrand, so changes to other cobrand email
templates don't affect the test; and clean up at the end of the
test so that it can be rerun without issue.
-rw-r--r-- | t/app/model/alert_type.t | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/t/app/model/alert_type.t b/t/app/model/alert_type.t index 62add01eb..ac8013278 100644 --- a/t/app/model/alert_type.t +++ b/t/app/model/alert_type.t @@ -97,6 +97,7 @@ my $alert = FixMyStreet::App->model('DB::Alert')->find_or_create( alert_type => 'new_updates', whensubscribed => $dt->ymd . ' ' . $dt->hms, confirmed => 1, + cobrand => 'default', } ); @@ -107,6 +108,7 @@ my $alert3 = FixMyStreet::App->model('DB::Alert')->find_or_create( alert_type => 'new_updates', whensubscribed => $dt->ymd . ' ' . $dt->hms, confirmed => 1, + cobrand => 'default', } ); @@ -485,7 +487,9 @@ subtest "check local alerts from cobrand send main site url for alerts for diffe like $body, qr#$expected2#, 'cobrand area report point to cobrand url'; }; -$report->comments->delete(); -$report->delete(); -done_testing(); - +END { + $mech->delete_user($user) if $user; + $mech->delete_user($user2) if $user2; + $mech->delete_user($user3) if $user3; + done_testing(); +} |