diff options
-rw-r--r-- | .cypress/cypress/integration/buckinghamshire.js | 9 | ||||
-rwxr-xr-x | bin/fixmystreet.com/fixture | 17 |
2 files changed, 25 insertions, 1 deletions
diff --git a/.cypress/cypress/integration/buckinghamshire.js b/.cypress/cypress/integration/buckinghamshire.js index 1f4641952..d5b14100a 100644 --- a/.cypress/cypress/integration/buckinghamshire.js +++ b/.cypress/cypress/integration/buckinghamshire.js @@ -42,4 +42,13 @@ describe('flytipping', function() { cy.get('body').should('contain', 'Thank you for your report'); }); + it('sets the site_code correctly', function() { + cy.get('.olMapViewport #fms_pan_zoom_zoomin').click(); + cy.wait('@roads-layer'); + cy.get('#map_box').click(290, 307); + cy.wait('@report-ajax'); + cy.get('select:eq(4)').select('Parks'); + cy.get('[name=site_code]').should('have.value', '7300268'); + }); + }); diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture index 1f6063a47..1fa17dfad 100755 --- a/bin/fixmystreet.com/fixture +++ b/bin/fixmystreet.com/fixture @@ -95,7 +95,7 @@ if ($opt->test_fixtures) { 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 => 2217, categories => ['Flytipping', 'Roads', 'Parks'], name => 'Buckinghamshire County Council' }, { area_id => 2257, categories => ['Flytipping', 'Graffiti'], name => 'Chiltern District Council' }, { area_id => 2397, categories => [ 'Graffiti' ], name => 'Northampton Borough Council' }, { area_id => 2483, categories => [ 'Potholes', 'Other' ], name => 'Hounslow Borough Council' }, @@ -139,6 +139,21 @@ if ($opt->test_fixtures) { $child_cat->update; $child_cat = FixMyStreet::DB->resultset("Contact")->find({ + body => $bodies->{2217}, + category => 'Parks', + }); + $child_cat->set_extra_fields({ + code => 'site_code', + datatype => 'string', + description => 'site code', + order => 100, + required => 'false', + variable => 'true', + automated => 'hidden_field', + }); + $child_cat->update; + + $child_cat = FixMyStreet::DB->resultset("Contact")->find({ body => $bodies->{2483}, category => 'Other', }); |