aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/alert_new.t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-05-11 11:37:36 +0100
committerStruan Donald <struan@exo.org.uk>2011-05-11 11:37:36 +0100
commit5f1db7700255e00ce492d57939f861f76b6ddadf (patch)
treeefa957abee5ae5fc36b9d3be871ec1f18ba92465 /t/app/controller/alert_new.t
parent4bb7f2af6a5a2e5f401d47f8aa2291000f95a641 (diff)
confirm alert subscription
Diffstat (limited to 't/app/controller/alert_new.t')
-rw-r--r--t/app/controller/alert_new.t11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/app/controller/alert_new.t b/t/app/controller/alert_new.t
index 8ee9d071b..94a4229ff 100644
--- a/t/app/controller/alert_new.t
+++ b/t/app/controller/alert_new.t
@@ -70,7 +70,8 @@ foreach my $test (
email => $test->{email},
alert_type => $type,
parameter => $test->{param1},
- parameter2 => $test->{param2}
+ parameter2 => $test->{param2},
+ confirmed => 0,
}
);
@@ -114,6 +115,14 @@ foreach my $test (
ok $token, 'new token found in database';
ok $token->data->{id} == $existing_id, 'subscribed to exsiting alert';
+
+ $mech->get_ok("/A/$url_token");
+ $mech->content_contains('subscribed');
+
+ $alert =
+ FixMyStreet::App->model('DB::Alert')->find( { id => $existing_id, } );
+
+ ok $alert->confirmed, 'alert set to confirmed';
};
}