diff options
author | Edmund von der Burg <evdb@mysociety.org> | 2011-03-18 15:50:35 +0000 |
---|---|---|
committer | Edmund von der Burg <evdb@mysociety.org> | 2011-03-18 15:50:35 +0000 |
commit | df8c32881171b5ea73d4e77030c9f642f7f19aab (patch) | |
tree | dd28e401d875df34e91af3b409b1fe2aacf913c1 | |
parent | 2a6169e6f6805f9276d616ccbcb22f9abfcf4d3c (diff) |
Controller to handle new reports and outline of tests needed
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports/New.pm | 26 | ||||
-rw-r--r-- | t/app/controller/reports_new.t | 48 |
2 files changed, 74 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports/New.pm b/perllib/FixMyStreet/App/Controller/Reports/New.pm new file mode 100644 index 000000000..c4da315e3 --- /dev/null +++ b/perllib/FixMyStreet/App/Controller/Reports/New.pm @@ -0,0 +1,26 @@ +package FixMyStreet::App::Controller::Reports::New; +use Moose; +use namespace::autoclean; + +BEGIN { extends 'Catalyst::Controller'; } + +=head1 NAME + +FixMyStreet::App::Controller::Reports::New + +=head1 DESCRIPTION + +Create a new report, or complete a partial one. + +=cut + +sub report_new : Path : Args(0) { + my ( $self, $c ) = @_; + + $c->response->body( + 'Matched FixMyStreet::App::Controller::Reports::New in Reports::New.'); +} + +__PACKAGE__->meta->make_immutable; + +1; diff --git a/t/app/controller/reports_new.t b/t/app/controller/reports_new.t new file mode 100644 index 000000000..e071eff9a --- /dev/null +++ b/t/app/controller/reports_new.t @@ -0,0 +1,48 @@ +use strict; +use warnings; +use Test::More; + +use Test::WWW::Mechanize::Catalyst 'FixMyStreet::App'; + +my $mech = Test::WWW::Mechanize::Catalyst->new(); +$mech->get_ok('/reports/new'); + +TODO: { + local $TODO = "paths to '/reports/new' not handled by catalyst yet"; + fail "Test that clicking on map sends user here"; + fail "Test that clicking on 'skip map' link sends user here"; + fail "Test that partial token sends user here"; +} + +#### test report creation for a user who does not have an account +# come to site +# fill in report +# recieve token +# confirm token +# report is confirmed +# user is created and logged in + + +#### test report creation for a user who has account but is not logged in +# come to site +# fill in report +# recieve token +# confirm token +# report is confirmed + + +#### test report creation for user with account and logged in +# come to site +# fill in report +# report is confirmed + + +#### test uploading an image + +#### test completing a partial report (eq flickr upload) + +#### test error cases when filling in a report + + + +done_testing(); |