aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/browser-tests4
-rwxr-xr-xbin/fixmystreet.com/fixture50
2 files changed, 42 insertions, 12 deletions
diff --git a/bin/browser-tests b/bin/browser-tests
index 6950c651d..37f542c92 100755
--- a/bin/browser-tests
+++ b/bin/browser-tests
@@ -14,7 +14,7 @@ use Getopt::Long ':config' => qw(pass_through auto_help);
my ($run_server, $run_cypress, $vagrant);
my $config_file = 'conf/general.yml-example';
-my $cobrand = [ 'fixmystreet', 'northamptonshire', 'bathnes' ];
+my $cobrand = [ 'fixmystreet', 'northamptonshire', 'bathnes', 'buckinghamshire' ];
my $coords = '51.532851,-2.284277';
my $area_id = 2608;
my $name = 'Borsetshire';
@@ -129,7 +129,7 @@ browser-tests [running options] [fixture options] [cypress options]
--help this help message
Fixture option:
- --cobrand Cobrand(s) to use, default is fixmystreet,northamptonshire,bathnes
+ --cobrand Cobrand(s) to use, default is fixmystreet,northamptonshire,bathnes,buckinghamshire
--coords Default co-ordinates for created reports
--area_id Area ID to use for created body
--name Name to use for created body
diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture
index 35e4e819c..3c3336811 100755
--- a/bin/fixmystreet.com/fixture
+++ b/bin/fixmystreet.com/fixture
@@ -92,18 +92,48 @@ for my $cat ('Dropped Kerbs', 'Skips') {
}
if ($opt->test_fixtures) {
- my $ncc = FixMyStreet::DB::Factory::Body->find_or_create({
- area_id => 2234,
- categories => [ 'Fallen Tree' ],
- name => 'Northamptonshire County Council',
+ my $bodies;
+ foreach (
+ { area_id => 2234, categories => ['Fallen Tree', 'Very Urgent'], name => 'Northamptonshire County Council' },
+ { area_id => 2217, categories => ['Flytipping', 'Roads'], name => 'Buckinghamshire County Council' },
+ { area_id => 2257, categories => ['Flytipping', 'Graffiti'], name => 'Chiltern District Council' },
+ { area_id => 2397, categories => [ 'Graffiti' ], name => 'Northampton Borough Council' },
+ ) {
+ $bodies->{$_->{area_id}} = FixMyStreet::DB::Factory::Body->find_or_create($_);
+ my $cats = join(', ', @{$_->{categories}});
+ say "Created body $_->{name} for MapIt area ID $_->{area_id}, categories $cats";
+ }
+
+ my $child_cat = FixMyStreet::DB->resultset("Contact")->find({
+ body => $bodies->{2234},
+ category => 'Very Urgent',
});
- say "Created body " . $ncc->name . " for MapIt area ID 2234, categories Fallen Tree";
- $ncc = FixMyStreet::DB::Factory::Body->find_or_create({
- area_id => 2397,
- categories => [ 'Graffiti' ],
- name => 'Northampton Borough Council',
+ $child_cat->set_extra_fields({
+ code => 'emergency',
+ datatype => 'string',
+ description => 'Please call us instead, it is very urgent.',
+ order => 1,
+ variable => 'false',
});
- say "Created body " . $ncc->name . " for MapIt area ID 2397, categories Graffiti";
+ $child_cat->update;
+
+ $child_cat = FixMyStreet::DB->resultset("Contact")->find({
+ body => $bodies->{2217},
+ category => 'Flytipping',
+ });
+ $child_cat->set_extra_fields({
+ code => 'road-placement',
+ datatype => 'singlevaluelist',
+ description => 'Is the fly-tip located on',
+ order => 100,
+ required => 'true',
+ variable => 'true',
+ values => [
+ { key => 'road', name => 'The road' },
+ { key => 'off-road', name => 'Off the road/on a verge' },
+ ],
+ });
+ $child_cat->update;
}
FixMyStreet::DB::Factory::ResponseTemplate->create({