aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/Mock/MapIt.pm1
-rw-r--r--t/cobrand/tfl.t38
2 files changed, 39 insertions, 0 deletions
diff --git a/t/Mock/MapIt.pm b/t/Mock/MapIt.pm
index 7dafb7af5..d50ebdc1d 100644
--- a/t/Mock/MapIt.pm
+++ b/t/Mock/MapIt.pm
@@ -46,6 +46,7 @@ my @PLACES = (
[ 'TW7 5JN', 51.482286, -0.328163, 2483, 'Hounslow Borough Council', 'LBO' ],
[ '?', 51.48111, -0.327219, 2483, 'Hounslow Borough Council', 'LBO' ],
[ '?', 51.482045, -0.327219, 2483, 'Hounslow Borough Council', 'LBO' ],
+ [ '?', 51.345714, -0.227959, 2457, 'Epsom and Ewell Borough Council', 'DIS' ],
[ 'CW11 1HZ', 53.145324, -2.370437, 21069, 'Cheshire East Council', 'UTA', 135301, 'Sandbach Town', 'UTW' ],
[ '?', 50.78301, -0.646929 ],
[ 'TA1 1QP', 51.023569, -3.099055, 2239, 'Somerset County Council', 'CTY', 2429, 'Taunton Deane Borough Council', 'DIS' ],
diff --git a/t/cobrand/tfl.t b/t/cobrand/tfl.t
index cdf3b1bab..8ddc3d671 100644
--- a/t/cobrand/tfl.t
+++ b/t/cobrand/tfl.t
@@ -19,6 +19,10 @@ FixMyStreet::DB->resultset('BodyArea')->find_or_create({
area_id => 2483, # Hounslow
body_id => $body->id,
});
+FixMyStreet::DB->resultset('BodyArea')->find_or_create({
+ area_id => 2457, # Epsom Ewell, outside London, for bus stop test
+ body_id => $body->id,
+});
my $superuser = $mech->create_user_ok('superuser@example.com', name => 'Super User', is_superuser => 1);
my $staffuser = $mech->create_user_ok('counciluser@example.com', name => 'Council User', from_body => $body, password => 'password');
$staffuser->user_body_permissions->create({
@@ -341,6 +345,40 @@ subtest "test report creation and reference number" => sub {
is $report->bodies_str, $body->id;
is $report->name, 'Joe Bloggs';
+};
+
+subtest "test bus report creation outside London, .com" => sub {
+ $mech->host('www.fixmystreet.com');
+ $mech->get_ok('/report/new?latitude=51.345714&longitude=-0.227959');
+ $mech->content_lacks('Bus things');
+ $mech->host('tfl.fixmystreet.com');
+};
+
+subtest "test bus report creation outside London" => sub {
+ $mech->get_ok('/report/new?latitude=51.345714&longitude=-0.227959');
+ $mech->submit_form_ok(
+ {
+ with_fields => {
+ # A bus stop in East Ewell
+ latitude => 51.345714,
+ longitude => -0.227959,
+ title => 'Test outwith London',
+ detail => 'Test report details.',
+ name => 'Joe Bloggs',
+ may_show_name => '1',
+ category => 'Bus stops',
+ }
+ },
+ "submit good details"
+ );
+ $mech->content_contains('Your issue is on its way to Transport for London');
+ is_deeply $mech->page_errors, [], "check there were no errors";
+
+ my $report = FixMyStreet::DB->resultset("Problem")->find({ title => 'Test outwith London'});
+ ok $report, "Found the report";
+ is $report->state, 'confirmed', "report confirmed";
+ is $report->bodies_str, $body->id;
+ $report->delete;
$mech->log_out_ok;
};