diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-06-04 16:38:01 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-06-05 17:54:31 +0100 |
commit | 0fb90368bb990ffa3ceab8d7ff2d345194f08d6f (patch) | |
tree | 156d120a06d21648b4c1479cd9951115955c1b0c /bin | |
parent | cd16308e716935a03cebf78d019d7baf4d3127a4 (diff) |
[Buckinghamshire] Add flytipping front end test.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/browser-tests | 4 | ||||
-rwxr-xr-x | bin/fixmystreet.com/fixture | 32 |
2 files changed, 29 insertions, 7 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 4a5bd3aed..8332bbe17 100755 --- a/bin/fixmystreet.com/fixture +++ b/bin/fixmystreet.com/fixture @@ -92,12 +92,34 @@ 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'], name => 'Northamptonshire County Council' }, + { area_id => 2217, categories => ['Flytipping', 'Roads'], name => 'Buckinghamshire County Council' }, + { area_id => 2257, categories => ['Flytipping', 'Graffiti'], name => 'Chiltern District 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->{2217}, + category => 'Flytipping', }); - say "Created body " . $ncc->name . " for MapIt area ID 2234, categories Fallen Tree"; + $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({ |