diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-02-19 17:46:06 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2015-02-19 18:25:50 +0000 |
commit | 44c62365da9cb25f9bd320650632a20a1e266229 (patch) | |
tree | 58ccae303685a753972edc0ea8d68f7ce6533cc3 | |
parent | ee386f44aeebe7814f258b3ba4a756e903c89719 (diff) |
Add URLs for easy looking at confirmation pages.
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Contact.pm | 5 | ||||
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Questionnaire.pm | 11 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Tokens.pm | 25 |
3 files changed, 39 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Contact.pm b/perllib/FixMyStreet/App/Controller/Contact.pm index f48518d77..222c0c242 100644 --- a/perllib/FixMyStreet/App/Controller/Contact.pm +++ b/perllib/FixMyStreet/App/Controller/Contact.pm @@ -41,6 +41,11 @@ Handle contact us form submission sub submit : Path('submit') : Args(0) { my ( $self, $c ) = @_; + if (my $testing = $c->req->params->{_test_}) { + $c->stash->{success} = $c->req->params->{success}; + return; + } + $c->res->redirect( '/contact' ) and return unless $c->req->method eq 'POST'; return diff --git a/perllib/FixMyStreet/App/Controller/Questionnaire.pm b/perllib/FixMyStreet/App/Controller/Questionnaire.pm index e75bb05ab..f6cc33e74 100755 --- a/perllib/FixMyStreet/App/Controller/Questionnaire.pm +++ b/perllib/FixMyStreet/App/Controller/Questionnaire.pm @@ -67,9 +67,16 @@ token), or the mini own-report one (when we'll have a problem ID). sub submit : Path('submit') { my ( $self, $c ) = @_; - if ( $c->req->params->{token} ) { + if (my $token = $c->req->params->{token}) { + if ($token eq '_test_') { + $c->stash->{been_fixed} = $c->req->params->{been_fixed}; + $c->stash->{new_state} = $c->req->params->{new_state}; + $c->stash->{template} = 'questionnaire/completed.html'; + return; + } $c->forward('submit_standard'); - } elsif ( $c->req->params->{problem} ) { + } elsif (my $p = $c->req->params->{problem}) { + $c->detach('creator_fixed') if $p eq '_test_'; $c->forward('submit_creator_fixed'); } else { $c->detach( '/page_error_404_not_found' ); diff --git a/perllib/FixMyStreet/App/Controller/Tokens.pm b/perllib/FixMyStreet/App/Controller/Tokens.pm index 00ac63599..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' ] ); @@ -134,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 @@ -169,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' ] ); |