diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-09-20 16:49:08 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-09-20 16:49:08 +0100 |
commit | 35b2e8fbcb4d382377ca8652d058dc263707b82b (patch) | |
tree | 1303dfbea8a36113fc4cbbe36f0f9d19ccbbb656 /bin | |
parent | 9d4e468cc2cbde4592ceada4c7471556154088d7 (diff) | |
parent | 1c5c614af7a0265bd296ef67c0d342b27898185c (diff) |
Merge branch '1529-cobrand-testing'
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fixmystreet.com/fixture | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture new file mode 100755 index 000000000..93982af8a --- /dev/null +++ b/bin/fixmystreet.com/fixture @@ -0,0 +1,39 @@ +#!/usr/bin/env perl +# +# This script will create a test body and its categories, covering the area of +# Westminster, and a user associated with that body, which should help testing +# of report interactions. + +use strict; +use warnings; + +BEGIN { + use File::Basename qw(dirname); + use File::Spec; + my $d = dirname(File::Spec->rel2abs($0)); + require "$d/../../setenv.pl"; +} + +use FixMyStreet::DB; + +my $body = FixMyStreet::DB->resultset("Body")->find_or_create({ name => 'Test City Council' }); +$body->body_areas->find_or_create({ area_id => 2504 }); +foreach ("Potholes", "Street lighting", "Graffiti") { + (my $email = lc $_) =~ s/ /-/g; + $body->contacts->find_or_create({ + category => $_, + email => $email . '@example.net', + confirmed => 't', + deleted => 'f', + whenedited => \'current_timestamp', + editor => 'fixture', + note => 'Created by fixture' + }); +} + +FixMyStreet::DB->resultset("User")->find_or_create({ + email => 'council@example.net', + name => 'Test City Council User', + from_body => $body, + password => 'password', +}); |