diff options
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/admin.t | 6 | ||||
-rw-r--r-- | t/app/controller/admin_permissions.t | 4 | ||||
-rw-r--r-- | t/app/controller/index.t | 2 | ||||
-rw-r--r-- | t/app/controller/my_planned.t | 2 | ||||
-rw-r--r-- | t/app/controller/report_display.t | 2 | ||||
-rw-r--r-- | t/app/controller/report_inspect.t | 6 | ||||
-rw-r--r-- | t/app/controller/report_new.t | 10 |
7 files changed, 15 insertions, 17 deletions
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t index 48a5edc44..07759197e 100644 --- a/t/app/controller/admin.t +++ b/t/app/controller/admin.t @@ -8,7 +8,7 @@ my $user2 = $mech->create_user_ok('test2@example.com', name => 'Test User 2'); my $superuser = $mech->create_user_ok('superuser@example.com', name => 'Super User', is_superuser => 1); -my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council', id => 2237); +my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council'); my $oxfordshirecontact = $mech->create_contact_ok( body_id => $oxfordshire->id, category => 'Potholes', email => 'potholes@example.com' ); $mech->create_contact_ok( body_id => $oxfordshire->id, category => 'Traffic lights', email => 'lights@example.com' ); my $oxfordshireuser = $mech->create_user_ok('counciluser@example.com', name => 'Council User', from_body => $oxfordshire); @@ -16,7 +16,7 @@ my $oxfordshireuser = $mech->create_user_ok('counciluser@example.com', name => ' my $oxford = $mech->create_body_ok(2421, 'Oxford City Council'); $mech->create_contact_ok( body_id => $oxford->id, category => 'Graffiti', email => 'graffiti@example.net' ); -my $bromley = $mech->create_body_ok(2482, 'Bromley Council', id => 2482); +my $bromley = $mech->create_body_ok(2482, 'Bromley Council'); my $user3 = $mech->create_user_ok('test3@example.com', name => 'Test User 2'); @@ -115,7 +115,7 @@ subtest 'check summary counts' => sub { my ($num_alerts) = $mech->content =~ /(\d+) confirmed alerts/; my ($num_qs) = $mech->content =~ /(\d+) questionnaires sent/; - $report->bodies_str(2237); + $report->bodies_str($oxfordshire->id); $report->cobrand('oxfordshire'); $report->update; diff --git a/t/app/controller/admin_permissions.t b/t/app/controller/admin_permissions.t index c79087639..f30777d16 100644 --- a/t/app/controller/admin_permissions.t +++ b/t/app/controller/admin_permissions.t @@ -6,10 +6,10 @@ my $user = $mech->create_user_ok('test@example.com', name => 'Test User'); my $user2 = $mech->create_user_ok('test2@example.com', name => 'Test User 2'); my $superuser = $mech->create_user_ok('superuser@example.com', name => 'Super User', is_superuser => 1); -my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council', id => 2237); +my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council'); my $oxfordshireuser = $mech->create_user_ok('counciluser@example.com', name => 'Council User', from_body => $oxfordshire); -my $bromley = $mech->create_body_ok(2482, 'Bromley Council', id => 2482); +my $bromley = $mech->create_body_ok(2482, 'Bromley Council'); END { $mech->delete_user( $user ); diff --git a/t/app/controller/index.t b/t/app/controller/index.t index 91d0a8fcb..654ebfcce 100644 --- a/t/app/controller/index.t +++ b/t/app/controller/index.t @@ -71,7 +71,7 @@ ok $mech->get('/report/' . $edinburgh_problems[2]->id); is $mech->res->code, 403, 'page forbidden'; is $problem_rs->count, $num+5; -my $oxon = $mech->create_body_ok(2237, 'Oxfordshire County Council', id => 2237); +my $oxon = $mech->create_body_ok(2237, 'Oxfordshire County Council'); subtest "prefilters /around if user has categories" => sub { my $user = $mech->log_in_ok('test@example.com'); my $categories = [ diff --git a/t/app/controller/my_planned.t b/t/app/controller/my_planned.t index 79d9e9e72..9e9ac06a2 100644 --- a/t/app/controller/my_planned.t +++ b/t/app/controller/my_planned.t @@ -4,7 +4,7 @@ my $mech = FixMyStreet::TestMech->new; $mech->get_ok('/my/planned'); is $mech->uri->path, '/auth', "got sent to the sign in page"; -my $body = $mech->create_body_ok(2237, 'Oxfordshire'); +my $body = $mech->create_body_ok(2237, 'Oxfordshire County Council'); my ($problem) = $mech->create_problems_for_body(1, $body->id, 'Test Title'); $mech->get_ok($problem->url); diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t index 5993a6304..a8c618d49 100644 --- a/t/app/controller/report_display.t +++ b/t/app/controller/report_display.t @@ -526,7 +526,7 @@ subtest "Zurich banners are displayed correctly" => sub { }; }; -my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council', id => 2237); +my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council'); my $oxfordshireuser = $mech->create_user_ok('counciluser@example.com', name => 'Council User', from_body => $oxfordshire); subtest "check user details show when a user has correct permissions" => sub { diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t index 8b375bfe4..a0407cb32 100644 --- a/t/app/controller/report_inspect.t +++ b/t/app/controller/report_inspect.t @@ -2,8 +2,8 @@ use FixMyStreet::TestMech; my $mech = FixMyStreet::TestMech->new; -my $brum = $mech->create_body_ok(2514, 'Birmingham City Council', id => 2514); -my $oxon = $mech->create_body_ok(2237, 'Oxfordshire County Council', id => 2237); +my $brum = $mech->create_body_ok(2514, 'Birmingham City Council'); +my $oxon = $mech->create_body_ok(2237, 'Oxfordshire County Council'); my $contact = $mech->create_contact_ok( body_id => $oxon->id, category => 'Cows', email => 'cows@example.net' ); my $rp = FixMyStreet::DB->resultset("ResponsePriority")->create({ body => $oxon, @@ -13,7 +13,7 @@ FixMyStreet::DB->resultset("ContactResponsePriority")->create({ contact => $contact, response_priority => $rp, }); -my $wodc = $mech->create_body_ok(2420, 'West Oxfordshire District Council', id => 2420); +my $wodc = $mech->create_body_ok(2420, 'West Oxfordshire District Council'); $mech->create_contact_ok( body_id => $wodc->id, category => 'Horses', email => 'horses@example.net' ); diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t index 36400ae81..0deef8196 100644 --- a/t/app/controller/report_new.t +++ b/t/app/controller/report_new.t @@ -36,13 +36,11 @@ for my $body ( { area_id => 2226, name => 'Gloucestershire County Council' }, { area_id => 2326, name => 'Cheltenham Borough Council' }, { area_id => 2504, name => 'Westminster City Council' }, - # The next three have fixed IDs because bits of the code rely on - # the body ID === MapIt area ID. - { area_id => 2482, name => 'Bromley Council', id => 2482 }, - { area_id => 2227, name => 'Hampshire County Council', id => 2227 }, - { area_id => 2333, name => 'Hart Council', id => 2333 }, + { area_id => 2482, name => 'Bromley Council' }, + { area_id => 2227, name => 'Hampshire County Council' }, + { area_id => 2333, name => 'Hart Council' }, ) { - my $body_obj = $mech->create_body_ok($body->{area_id}, $body->{name}, id => $body->{id}); + my $body_obj = $mech->create_body_ok($body->{area_id}, $body->{name}); push @bodies, $body_obj; $body_ids{$body->{area_id}} = $body_obj->id; } |