diff options
Diffstat (limited to 't/app/controller/report_updates.t')
-rw-r--r-- | t/app/controller/report_updates.t | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index 3986d01b5..2765ed246 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -35,7 +35,7 @@ my $dt = DateTime->new( my $report = FixMyStreet::App->model('DB::Problem')->find_or_create( { postcode => 'SW1A 1AA', - council => '2504', + bodies_str => '2504', areas => ',105255,11806,11828,2247,2504,', category => 'Other', title => 'Test 2', @@ -409,7 +409,7 @@ $report->update; subtest 'check non authority user cannot change set state' => sub { $mech->log_in_ok( $user->email ); - $user->from_council( 0 ); + $user->from_body( undef ); $user->update; $mech->get_ok("/report/$report_id"); @@ -434,10 +434,12 @@ 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_council( 2504 ); + $user->from_body( 2504 ); $user->update; $mech->get_ok("/report/$report_id"); @@ -586,18 +588,18 @@ for my $test ( state => 'fixed', }, state => 'fixed - council', - report_councils => '2504,2505', + report_bodies => '2504,2505', }, ) { subtest $test->{desc} => sub { $report->comments->delete; - if ( $test->{ report_councils } ) { - $report->council( $test->{ report_councils } ); + if ( $test->{ report_bodies } ) { + $report->bodies_str( $test->{ report_bodies } ); $report->update; } $mech->log_in_ok( $user->email ); - $user->from_council( 2504 ); + $user->from_body( 2504 ); $user->update; $mech->get_ok("/report/$report_id"); @@ -670,7 +672,7 @@ subtest 'check meta correct for comments marked confirmed but not marked open' = subtest "check first comment with no status change has no status in meta" => sub { $mech->log_in_ok( $user->email ); - $user->from_council( 0 ); + $user->from_body( undef ); $user->update; my $comment = $report->comments->first; @@ -684,7 +686,7 @@ subtest "check first comment with no status change has no status in meta" => sub subtest "check comment with no status change has not status in meta" => sub { $mech->log_in_ok( $user->email ); - $user->from_council( 0 ); + $user->from_body( undef ); $user->update; my $comment = $report->comments->first; @@ -718,7 +720,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_council( 2504 ); + $user->from_body( 2504 ); $user->update; $mech->get_ok("/report/$report_id"); @@ -820,11 +822,11 @@ subtest 'check meta correct for second comment marking as reopened' => sub { like $update_meta->[1], qr/reopened$/, 'update meta says reopened'; }; -$user->from_council(0); +$user->from_body(undef); $user->update; $report->state('confirmed'); -$report->council('2504'); +$report->bodies_str('2504'); $report->update; for my $test ( |