diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-02-01 15:28:08 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-02-04 06:53:02 +0000 |
commit | 488a8f21a0c1bc2b9501c9d94d69db56cccd80ae (patch) | |
tree | 68becf501e9492466a80015e8ace9a7fb1557cfa /t/app/controller/report_updates.t | |
parent | 3e0d12e8584d132b573f536ab5cd01e24241827b (diff) | |
parent | 28aa1dd7fb1c9bc93aa204afae67cf68fe36ee6b (diff) |
Merge remote branch 'origin/zurich'
Conflicts:
bin/open311-populate-service-list
bin/send-comments
bin/update-all-reports
conf/crontab.ugly
db/schema.sql
perllib/FixMyStreet/App/Controller/Admin.pm
perllib/FixMyStreet/App/Controller/Report/New.pm
perllib/FixMyStreet/App/Controller/Reports.pm
perllib/FixMyStreet/Cobrand/Default.pm
perllib/FixMyStreet/Cobrand/LichfieldDC.pm
perllib/FixMyStreet/DB/Result/Open311conf.pm
perllib/FixMyStreet/DB/Result/Problem.pm
perllib/FixMyStreet/DB/ResultSet/Problem.pm
perllib/FixMyStreet/SendReport.pm
perllib/FixMyStreet/SendReport/Email.pm
perllib/FixMyStreet/SendReport/Open311.pm
perllib/Open311/GetServiceRequestUpdates.pm
perllib/Open311/PopulateServiceList.pm
t/app/controller/report_new.t
t/app/controller/rss.t
templates/web/bromley/report/display.html
templates/web/default/admin/council_contacts.html
templates/web/default/common_header_tags.html
templates/web/default/dashboard/index.html
templates/web/default/front/stats.html
templates/web/default/report/_main.html
templates/web/default/report/update-form.html
templates/web/emptyhomes/index.html
templates/web/emptyhomes/report/display.html
templates/web/emptyhomes/report/new/councils_text_all.html
templates/web/emptyhomes/reports/body.html
templates/web/emptyhomes/reports/index.html
templates/web/fixmystreet/report/new/fill_in_details_form.html
templates/web/fixmystreet/report/update-form.html
web/cobrands/fixmystreet/fixmystreet.js
web/js/fixmystreet.js
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 ( |