aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/report_updates.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2014-12-11 16:42:53 +0000
committerMatthew Somerville <matthew@mysociety.org>2014-12-12 12:41:31 +0000
commit43c98742ee85c73c4783451ceeea28108bb793c6 (patch)
tree40ced5bfa4a7b6c0328da62f8332cdc06a6637ea /t/app/controller/report_updates.t
parent4edc79829ebf2f6dcce11185e929a2a592a3f5ed (diff)
By default, use area-based alerts.
The body-based alert only works if the body ID matches the MapIt ID. This fixes #959. Further work needs to be done to enable proper body-based alerts that work properly in all circumstances. Consequently, factor out fixed body IDs from many tests. Also fix a couple of tests not overriding geocoder correctly.
Diffstat (limited to 't/app/controller/report_updates.t')
-rw-r--r--t/app/controller/report_updates.t16
1 files changed, 8 insertions, 8 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index 99c53ef01..64ed91ac0 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -23,6 +23,8 @@ my $user2 =
->find_or_create( { email => 'commenter@example.com', name => 'Commenter' } );
ok $user2, "created comment user";
+my $body = $mech->create_body_ok(2504, 'Westminster City Council');
+
my $dt = DateTime->new(
year => 2011,
month => 04,
@@ -35,7 +37,7 @@ my $dt = DateTime->new(
my $report = FixMyStreet::App->model('DB::Problem')->find_or_create(
{
postcode => 'SW1A 1AA',
- bodies_str => '2504',
+ bodies_str => $body->id,
areas => ',105255,11806,11828,2247,2504,',
category => 'Other',
title => 'Test 2',
@@ -513,12 +515,10 @@ subtest 'check non authority user cannot change set state' => sub {
is $report->state, 'confirmed', 'state unchanged';
};
-$mech->create_body_ok(2504, 'Westminster City Council');
-
for my $state ( qw/unconfirmed hidden partial/ ) {
subtest "check that update cannot set state to $state" => sub {
$mech->log_in_ok( $user->email );
- $user->from_body( 2504 );
+ $user->from_body( $body->id );
$user->update;
$mech->get_ok("/report/$report_id");
@@ -668,7 +668,7 @@ for my $test (
state => 'fixed',
},
state => 'fixed - council',
- report_bodies => '2504,2505',
+ report_bodies => $body->id . ',2505',
},
) {
subtest $test->{desc} => sub {
@@ -679,7 +679,7 @@ for my $test (
}
$mech->log_in_ok( $user->email );
- $user->from_body( 2504 );
+ $user->from_body( $body->id );
$user->update;
$mech->get_ok("/report/$report_id");
@@ -798,7 +798,7 @@ subtest "check comment with no status change has not status in meta" => sub {
my $update_meta = $mech->extract_update_metas;
unlike $update_meta->[1], qr/marked as/, 'update meta does not include state change';
- $user->from_body( 2504 );
+ $user->from_body( $body->id );
$user->update;
$mech->get_ok("/report/$report_id");
@@ -905,7 +905,7 @@ $user->from_body(undef);
$user->update;
$report->state('confirmed');
-$report->bodies_str('2504');
+$report->bodies_str($body->id);
$report->update;
for my $test (