aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand
diff options
context:
space:
mode:
Diffstat (limited to 't/cobrand')
-rw-r--r--t/cobrand/fixmybarangay.t23
1 files changed, 22 insertions, 1 deletions
diff --git a/t/cobrand/fixmybarangay.t b/t/cobrand/fixmybarangay.t
index a431ca62b..edb14fe3d 100644
--- a/t/cobrand/fixmybarangay.t
+++ b/t/cobrand/fixmybarangay.t
@@ -28,7 +28,7 @@ $luz->update( { send_method => 'Email' } );
my $bsn = $mech->create_body_ok( 2, 'Bgy BSN', id => 2 );
$bsn->update( { send_method => 'Email' } );
-my $dps = $mech->create_body_ok( 3, 'DPS' );
+my $dps = $mech->create_body_ok( 3, 'DPS', id => 3 );
$dps->update( { send_method => 'Open311', endpoint => 'http://dps.endpoint.example.com', jurisdiction => 'FMB', api_key => 'test' } );
FixMyStreet::App->model('DB::BodyArea')->find_or_create({ area_id => 1, body_id => $dps->id });
FixMyStreet::App->model('DB::BodyArea')->find_or_create({ area_id => 2, body_id => $dps->id });
@@ -104,6 +104,27 @@ my $fmb_test_email = 'luz_test_user@example.com';
my $user = FixMyStreet::App->model('DB::User')->find_or_create( { email => $fmb_test_email, from_body => $luz->id, password => 'fmbsecret' } );
ok $user, "test user does exist";
+my $alert = FixMyStreet::App->model('DB::Alert')->find_or_create({
+ user => $user,
+ parameter => '-0.142497580865087',
+ parameter2 => '51.5016605453401',
+ alert_type => 'local_problems',
+ whensubscribed => '2014-01-01 10:00:00',
+ confirmed => 1,
+ cobrand => 'fixmybarangay',
+});
+
+FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'fixmybarangay' ],
+}, sub {
+ FixMyStreet::App->model('DB::AlertType')->email_alerts();
+};
+
+$mech->email_count_is(1);
+$email = $mech->get_email;
+like $email->body, qr/The following FixMyBarangay reports/, 'Start of email looks correct';
+$mech->clear_emails_ok;
+
$mech->log_out_ok;
$mech->get_ok( '/report/' . $luz_report->id );
$mech->content_lacks( "Remove from site" );