aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/model/problem.t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-09-12 15:59:27 +0100
committerStruan Donald <struan@exo.org.uk>2013-09-12 15:59:27 +0100
commit30bb1746b703a12d7ec3c698eea63ac9e1183037 (patch)
treeff645f19804c76b43012dda9b3e2d77f7ee1bf69 /t/app/model/problem.t
parent64f97d4cf9ad64905006e504f3ffb47fb373eca9 (diff)
mechanism to stop app store tests being sent
In order to allow the iOS app to be tested in the app store we need to allow the user to create a report but we don't want to send it. To allow this hide reports with a specific title during send_reports
Diffstat (limited to 't/app/model/problem.t')
-rw-r--r--t/app/model/problem.t29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/app/model/problem.t b/t/app/model/problem.t
index 5d02aef2b..c9fa1a6e3 100644
--- a/t/app/model/problem.t
+++ b/t/app/model/problem.t
@@ -630,6 +630,35 @@ subtest 'check can turn on report sent email alerts' => sub {
like $email->body, qr/Your report about/, 'report sent body correct';
};
+
+subtest 'check iOS app store test reports not sent' => sub {
+ $mech->clear_emails_ok;
+
+ FixMyStreet::App->model('DB::Problem')->search(
+ {
+ whensent => undef
+ }
+ )->update( { whensent => \'ms_current_timestamp()' } );
+
+ $problem->discard_changes;
+ $problem->update( {
+ title => 'App store test',
+ state => 'confirmed',
+ confirmed => \'ms_current_timestamp()',
+ whensent => undef,
+ category => 'potholes',
+ send_fail_count => 0,
+ } );
+
+ FixMyStreet::App->model('DB::Problem')->send_reports();
+
+ $mech->email_count_is( 0 );
+
+ $problem->discard_changes();
+ is $problem->state, 'hidden', 'iOS test reports are hidden automatically';
+ is $problem->whensent, undef, 'iOS test reports are not sent';
+};
+
subtest 'check reports from abuser not sent' => sub {
$mech->clear_emails_ok;