aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
Diffstat (limited to 't/app')
-rw-r--r--t/app/controller/around.t6
-rw-r--r--t/app/sendreport/email.t17
2 files changed, 22 insertions, 1 deletions
diff --git a/t/app/controller/around.t b/t/app/controller/around.t
index 3f0fff666..b123692fa 100644
--- a/t/app/controller/around.t
+++ b/t/app/controller/around.t
@@ -228,6 +228,7 @@ subtest 'check category, status and extra filtering works on /around' => sub {
# Regression test for filter_category in /around URL
FixMyStreet::override_config {
+ ALLOWED_COBRANDS => 'fixmystreet',
MAPIT_URL => 'http://mapit.uk/',
}, sub {
$mech->get_ok( '/around?filter_category=Pothole&bbox=' . $bbox );
@@ -331,15 +332,17 @@ subtest 'check skip_around skips around page' => sub {
FixMyStreet::override_config {
MAPIT_URL => 'http://mapit.uk/',
+ MAPIT_TYPES => ['CTY', 'DIS'],
}, sub {
$mech->get('/around?latitude=51.754926&longitude=-1.256179');
- is $mech->res->code, 302, "around page is a redirect";
+ is $mech->res->previous->code, 302, "around page is a redirect";
is $mech->uri->path, '/report/new', "and redirects to /report/new";
};
};
subtest 'check map zoom level customisation' => sub {
FixMyStreet::override_config {
+ ALLOWED_COBRANDS => 'fixmystreet',
MAPIT_URL => 'http://mapit.uk/',
MAP_TYPE => 'OSM',
}, sub {
@@ -350,6 +353,7 @@ subtest 'check map zoom level customisation' => sub {
FixMyStreet::override_config {
+ ALLOWED_COBRANDS => 'fixmystreet',
MAPIT_URL => 'http://mapit.uk/',
MAP_TYPE => 'Tester',
}, sub {
diff --git a/t/app/sendreport/email.t b/t/app/sendreport/email.t
index 6b292725b..3e6db4f67 100644
--- a/t/app/sendreport/email.t
+++ b/t/app/sendreport/email.t
@@ -20,6 +20,8 @@ my $contact = $mech->create_contact_ok(
);
my $row = FixMyStreet::DB->resultset('Problem')->new( {
+ latitude => 51.023569,
+ longitude => -3.099055,
bodies_str => '1000',
category => 'category',
cobrand => '',
@@ -67,4 +69,19 @@ foreach my $test ( {
};
}
+$body->body_areas->delete;
+$body->body_areas->create({ area_id => 2429 });
+
+subtest 'Test special behaviour' => sub {
+ my $e = FixMyStreet::SendReport::Email->new;
+ $contact->update( { state => 'confirmed', email => 'SPECIAL' } );
+ $e->add_body( $body );
+ FixMyStreet::override_config {
+ MAPIT_URL => 'http://mapit.uk/'
+ }, sub {
+ my ($e) = $e->build_recipient_list( $row, {} );
+ like $e->[0], qr/tauntondeane/, 'correct recipient';
+ };
+};
+
done_testing();