aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand/fixmybarangay.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-03-13 18:04:55 +0000
committerMatthew Somerville <matthew@mysociety.org>2015-03-13 21:54:29 +0000
commit76e533bd318cb4208faa1bf5cd0c00bde9e08e6c (patch)
tree7ada0b46c3e75b4d3977ca27960638c191354cc7 /t/cobrand/fixmybarangay.t
parente22563a5c8fde74a8a6f1de29948eb45487e9597 (diff)
Factor out test contact creation to function.
Diffstat (limited to 't/cobrand/fixmybarangay.t')
-rw-r--r--t/cobrand/fixmybarangay.t20
1 files changed, 4 insertions, 16 deletions
diff --git a/t/cobrand/fixmybarangay.t b/t/cobrand/fixmybarangay.t
index edb14fe3d..316739dfa 100644
--- a/t/cobrand/fixmybarangay.t
+++ b/t/cobrand/fixmybarangay.t
@@ -37,28 +37,16 @@ FixMyStreet::App->model('DB::BodyArea')->find_or_create({ area_id => 2, body_id
# TODO: log in as a Bgy user, and create a report using the front end,
# testing that the drop-down has the right things in it, and so on.
-my %contact_params = (
- confirmed => 1,
- deleted => 0,
- editor => 'Test',
- whenedited => \'current_timestamp',
- note => 'Created for test',
-);
-FixMyStreet::App->model('DB::Contact')->search( {
- email => { 'like', '%example.com' },
-} )->delete;
-my $contact1 = FixMyStreet::App->model('DB::Contact')->find_or_create( {
- %contact_params,
+$mech->create_contact_ok(
body_id => $luz->id,
category => 'Streetlight (BGY)',
email => 'bgy@example.com',
-} );
-my $contact2 = FixMyStreet::App->model('DB::Contact')->find_or_create( {
- %contact_params,
+);
+$mech->create_contact_ok(
body_id => $dps->id,
category => 'Streetlight (DPS)',
email => 'LIGHT',
-} );
+);
# Create a couple of reports