diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-06-10 11:56:15 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-06-10 11:56:15 +0100 |
commit | 3a81cb62a106adf77d226f3ab9a6c8d4381cb39c (patch) | |
tree | 109054e100207a7b82807ea0ec54e960729f19e2 | |
parent | 0e163ffb8e8f9b9fa5ca1193ad2f3965f98926ec (diff) |
Tidy up a couple of FIXMEs.
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Rss.pm | 12 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 3 | ||||
-rw-r--r-- | t/app/controller/report_import.t | 68 |
3 files changed, 33 insertions, 50 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm index 4c048b56d..0edded1e3 100755 --- a/perllib/FixMyStreet/App/Controller/Rss.pm +++ b/perllib/FixMyStreet/App/Controller/Rss.pm @@ -30,17 +30,7 @@ sub updates : LocalRegex('^(\d+)$') { my ( $self, $c ) = @_; my $id = $c->req->captures->[0]; - my $problem = $c->cobrand->problems->find( { id => $id } ); - - # FIXME Put these 404/410 checks in central place - Report.pm does it too. - if ( !$problem || $problem->state eq 'unconfirmed' ) { - $c->detach( '/page_error_404_not_found', [ _('Unknown problem ID') ] ); - } elsif ( $problem->state eq 'hidden' ) { - $c->detach( - '/page_error_410_gone', - [ _('That report has been removed from FixMyStreet.') ] - ); - } + $c->forward( '/report/load_problem_or_display_error', [ $id ] ); $c->stash->{type} = 'new_updates'; $c->stash->{qs} = 'report/' . $id; diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index f3ef136a8..332a0052d 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -194,7 +194,8 @@ Set the language and domain of the site based on the cobrand and host. sub set_lang_and_domain { my ( $self, $lang, $unicode, $dir ) = @_; my $set_lang = mySociety::Locale::negotiate_language( - 'en-gb,English,en_GB|nb,Norwegian,nb_NO', $lang ); # XXX Testing + 'en-gb,English,en_GB', $lang + ); mySociety::Locale::gettext_domain( 'FixMyStreet', $unicode, $dir ); mySociety::Locale::change(); return $set_lang; diff --git a/t/app/controller/report_import.t b/t/app/controller/report_import.t index 4f225fc5a..154de13d8 100644 --- a/t/app/controller/report_import.t +++ b/t/app/controller/report_import.t @@ -129,25 +129,21 @@ subtest "Submit a correct entry" => sub { }, "check imported fields are shown"; - TODO: { - local $TODO = "'/report/123' urls not served by catalyst yet"; - - # change the details - $mech->submit_form_ok( # - { - with_fields => { - name => 'New Test User', - email => 'test@example.com', - title => 'New Test report', - detail => 'This is a test report', - phone => '01234 567 890', - may_show_name => '1', - category => 'Street lighting', - } - }, - "Update details and save" - ); - } + # change the details + $mech->submit_form_ok( # + { + with_fields => { + name => 'New Test User', + email => 'test@example.com', + title => 'New Test report', + detail => 'This is a test report', + phone => '01234 567 890', + may_show_name => '1', + category => 'Street lighting', + } + }, + "Update details and save" + ); # check that report has been created my $user = @@ -214,25 +210,21 @@ subtest "Submit a correct entry (with location)" => sub { }, "check imported fields are shown"; - TODO: { - local $TODO = "'/report/123' urls not served by catalyst yet"; - - # change the details - $mech->submit_form_ok( # - { - with_fields => { - name => 'New Test User ll', - email => 'test-ll@example.com', - title => 'New Test report ll', - detail => 'This is a test report ll', - phone => '01234 567 890', - may_show_name => '1', - category => 'Street lighting', - } - }, - "Update details and save" - ); - } + # change the details + $mech->submit_form_ok( # + { + with_fields => { + name => 'New Test User ll', + email => 'test-ll@example.com', + title => 'New Test report ll', + detail => 'This is a test report ll', + phone => '01234 567 890', + may_show_name => '1', + category => 'Street lighting', + } + }, + "Update details and save" + ); # check that report has been created my $user = |