aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Tokens.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Tokens.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Tokens.pm28
1 files changed, 26 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Tokens.pm b/perllib/FixMyStreet/App/Controller/Tokens.pm
index 44cb2429d..c8a7531d6 100644
--- a/perllib/FixMyStreet/App/Controller/Tokens.pm
+++ b/perllib/FixMyStreet/App/Controller/Tokens.pm
@@ -28,6 +28,16 @@ problem but are not logged in.
sub confirm_problem : Path('/P') {
my ( $self, $c, $token_code ) = @_;
+ if ($token_code eq '_test_') {
+ $c->stash->{report} = {
+ id => 123,
+ title => 'Title of Report',
+ bodies_str => 'True',
+ url => '/report/123',
+ };
+ return;
+ }
+
my $auth_token =
$c->forward( 'load_auth_token', [ $token_code, 'problem' ] );
@@ -37,7 +47,7 @@ sub confirm_problem : Path('/P') {
# Look at all problems, not just cobrand, in case am approving something we don't actually show
my $problem = $c->model('DB::Problem')->find( { id => $problem_id } )
|| $c->detach('token_error');
- $c->stash->{problem} = $problem;
+ $c->stash->{report} = $problem;
if ( $problem->state eq 'unconfirmed' && $auth_token->created < DateTime->now->subtract( months => 1 ) ) {
$c->stash->{template} = 'errors/generic.html';
@@ -83,7 +93,6 @@ sub confirm_problem : Path('/P') {
) if $problem->state eq 'unconfirmed';
# Subscribe problem reporter to email updates
- $c->stash->{report} = $c->stash->{problem};
$c->forward( '/report/new/create_reporter_alert' );
# log the problem creation user in to the site
@@ -135,6 +144,11 @@ alert but are not logged in.
sub confirm_alert : Path('/A') {
my ( $self, $c, $token_code ) = @_;
+ if ($token_code eq '_test_') {
+ $c->stash->{confirm_type} = $c->req->params->{confirm_type};
+ return;
+ }
+
my $auth_token = $c->forward( 'load_auth_token', [ $token_code, 'alert' ] );
# Load the problem
@@ -170,6 +184,16 @@ update but are not logged in.
sub confirm_update : Path('/C') {
my ( $self, $c, $token_code ) = @_;
+ if ($token_code eq '_test_') {
+ $c->stash->{problem} = {
+ id => 123,
+ title => 'Title of Report',
+ bodies_str => 'True',
+ url => '/report/123',
+ };
+ return;
+ }
+
my $auth_token =
$c->forward( 'load_auth_token', [ $token_code, 'comment' ] );