diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-06-13 18:39:05 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-06-20 15:02:11 +0100 |
commit | e57cbf483790bedfef6496be3c7ffa42882c3ffc (patch) | |
tree | d01788502457f801a846cdac78213df5ecdf1ea5 /t/app/model | |
parent | a5f311e5147621f285cf31647ce675c502095882 (diff) |
[UK] Remove requirement for fixed body IDs.
Historically in UK cobrands, bodies have had IDs the same as the MapIt
area ID they cover. This can be confusing (if you are setting up a dev
environment, say) and should not be necessary. This commit removes the
requirement entirely, by switching any ID checks to either the name of
the body, or the actual area it covers.
One note: the body name in the test has to match so that we do not get
two bodies both covering 2237 created. This will not be necessary when
the tests are compartmentalized in the next commit.
Diffstat (limited to 't/app/model')
-rw-r--r-- | t/app/model/defecttype.t | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/t/app/model/defecttype.t b/t/app/model/defecttype.t index 6a03deded..c3e3035a6 100644 --- a/t/app/model/defecttype.t +++ b/t/app/model/defecttype.t @@ -2,13 +2,13 @@ use FixMyStreet::App; use FixMyStreet::TestMech; my $mech = FixMyStreet::TestMech->new; -my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council', id => 2237); +my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council'); my $potholes_contact = $mech->create_contact_ok( body_id => $oxfordshire->id, category => 'Potholes', email => 'potholes@example.com' ); my $traffic_lights_contact =$mech->create_contact_ok( body_id => $oxfordshire->id, category => 'Traffic lights', email => 'lights@example.com' ); my $potholes_defect_type = FixMyStreet::App->model('DB::DefectType')->find_or_create( { - body_id => 2237, + body_id => $oxfordshire->id, name => 'Potholes', description => 'This defect type is to do with potholes' } @@ -19,7 +19,7 @@ $potholes_defect_type->contact_defect_types->find_or_create({ my $general_defect_type = FixMyStreet::App->model('DB::DefectType')->find_or_create( { - body_id => 2237, + body_id => $oxfordshire->id, name => 'All categories', description => 'This defect type is for all categories' } |