diff options
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/report_inspect.t | 22 | ||||
-rw-r--r-- | t/app/controller/rss.t | 1 |
2 files changed, 21 insertions, 2 deletions
diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t index 4caeef501..831959fff 100644 --- a/t/app/controller/report_inspect.t +++ b/t/app/controller/report_inspect.t @@ -6,8 +6,8 @@ use FixMyStreet::TestMech; my $mech = FixMyStreet::TestMech->new; -my $brum = $mech->create_body_ok(2514, 'Birmingham City Council'); -my $oxon = $mech->create_body_ok(2237, 'Oxfordshire County Council'); +my $brum = $mech->create_body_ok(2514, 'Birmingham City Council', id => 2514); +my $oxon = $mech->create_body_ok(2237, 'Oxfordshire County Council', id => 2237); my $contact = $mech->create_contact_ok( body_id => $oxon->id, category => 'Cows', email => 'cows@example.net' ); my $rp = FixMyStreet::DB->resultset("ResponsePriority")->create({ body => $oxon, @@ -55,11 +55,13 @@ FixMyStreet::override_config { subtest "test inspect & instruct submission" => sub { $report->unset_extra_metadata('inspected'); $report->update; + my $reputation = $report->user->get_extra_metadata("reputation"); $mech->get_ok("/report/$report_id/inspect"); $mech->submit_form_ok({ button => 'save', with_fields => { public_update => "This is a public update.", save_inspected => "1" } }); $report->discard_changes; is $report->comments->first->text, "This is a public update.", 'Update was created'; is $report->get_extra_metadata('inspected'), 1, 'report marked as inspected'; + is $report->user->get_extra_metadata('reputation'), $reputation+1, "User reputation was increased"; }; subtest "test update is required when instructing" => sub { @@ -107,6 +109,22 @@ FixMyStreet::override_config { } }; +FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.mysociety.org/', + ALLOWED_COBRANDS => 'oxfordshire', +}, sub { + subtest "test negative reputation" => sub { + my $reputation = $report->user->get_extra_metadata("reputation"); + + $mech->get_ok("/report/$report_id"); + $mech->submit_form( button => 'remove_from_site' ); + + $report->discard_changes; + is $report->user->get_extra_metadata('reputation'), $reputation-1, "User reputation was decreased"; + }; +}; + + END { $mech->delete_body($oxon); $mech->delete_body($brum); diff --git a/t/app/controller/rss.t b/t/app/controller/rss.t index 8b39219fa..4f737dda7 100644 --- a/t/app/controller/rss.t +++ b/t/app/controller/rss.t @@ -50,6 +50,7 @@ FixMyStreet::override_config { }; $mech->content_contains( "Testing, 10th October" ); $mech->content_lacks( 'Nearest road to the pin' ); +is $mech->response->header('Access-Control-Allow-Origin'), '*'; $report->geocode( { |