aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/browser-tests2
-rwxr-xr-xbin/fixmystreet.com/fixture10
2 files changed, 11 insertions, 1 deletions
diff --git a/bin/browser-tests b/bin/browser-tests
index a3548e50b..20f2f761d 100755
--- a/bin/browser-tests
+++ b/bin/browser-tests
@@ -79,7 +79,7 @@ sub run {
# Set up, and load in some data
system('bin/make_css', 'fixmystreet.com');
- system('bin/fixmystreet.com/fixture', '--nonrandom', '--coords', $coords, '--name', $name, '--area-id', $area_id, '--commit');
+ system('bin/fixmystreet.com/fixture', '--test_fixtures', '--nonrandom', '--coords', $coords, '--name', $name, '--area-id', $area_id, '--commit');
}
my $pid;
diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture
index c75cb53bf..4a5bd3aed 100755
--- a/bin/fixmystreet.com/fixture
+++ b/bin/fixmystreet.com/fixture
@@ -31,6 +31,7 @@ my ($opt, $usage) = describe_options(
[ 'empty', "Empty all tables of the database first" ],
[ 'commit', "Actually commit changes to the database" ],
[ 'nonrandom', "Output things in a fixed manner, for testing" ],
+ [ 'test_fixtures', "Generate test specific fixtures" ],
[ 'coords=s', "Co-ordinates to use instead of example postcode" ],
[ 'help', "print usage message and exit", { shortcircuit => 1 } ],
);
@@ -90,6 +91,15 @@ for my $cat ('Dropped Kerbs', 'Skips') {
$child_cat->update;
}
+if ($opt->test_fixtures) {
+ my $ncc = FixMyStreet::DB::Factory::Body->find_or_create({
+ area_id => 2234,
+ categories => [ 'Fallen Tree' ],
+ name => 'Northamptonshire County Council',
+ });
+ say "Created body " . $ncc->name . " for MapIt area ID 2234, categories Fallen Tree";
+}
+
FixMyStreet::DB::Factory::ResponseTemplate->create({
body => $body, title => 'Generic',
text => 'Thank you for your report, we will be in touch with an update soon.' });