From f05dc118efd45e0df7f3e8d04366f732440f4fd6 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 13 Dec 2012 18:53:25 +0000 Subject: Update tests for new names of things and bodies needing to exist. --- t/app/controller/rss.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/app/controller/rss.t') diff --git a/t/app/controller/rss.t b/t/app/controller/rss.t index 77e2c7ee1..e683806cd 100644 --- a/t/app/controller/rss.t +++ b/t/app/controller/rss.t @@ -17,7 +17,7 @@ my $user1 = FixMyStreet::App->model('DB::User') my $report = FixMyStreet::App->model('DB::Problem')->find_or_create( { postcode => 'eh1 1BB', - council => '2651', + bodies_str => '2651', areas => ',11808,135007,14419,134935,2651,20728,', category => 'Street lighting', title => 'Testing', -- cgit v1.2.3 From 0b94fccf4d41d674c9544b17983ed6bba12ddf95 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 13 Dec 2012 21:18:46 +0000 Subject: Fix for a missed council column rename, and a test that would have caught it. --- t/app/controller/rss.t | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 't/app/controller/rss.t') diff --git a/t/app/controller/rss.t b/t/app/controller/rss.t index e683806cd..002d63d67 100644 --- a/t/app/controller/rss.t +++ b/t/app/controller/rss.t @@ -113,6 +113,69 @@ $mech->content_contains( "Testing, 10th October" ); $mech->content_contains( '18 North Bridge, Edinburgh' ); $report->delete(); + +my $now = DateTime->now(); +my $report_to_council = FixMyStreet::App->model('DB::Problem')->find_or_create( + { + postcode => 'WS13 6YY', + bodies_str => '2434', + areas => ',2434,2240,', + category => 'Other', + title => 'council report', + detail => 'Test 2 Detail', + used_map => 't', + name => 'Test User', + anonymous => 'f', + state => 'closed', + confirmed => $now->ymd . ' ' . $now->hms, + lang => 'en-gb', + service => '', + cobrand => 'default', + cobrand_data => '', + send_questionnaire => 't', + latitude => '52.727588', + longitude => '-1.731322', + user_id => $user1->id, + } +); + +my $report_to_county_council = FixMyStreet::App->model('DB::Problem')->find_or_create( + { + postcode => 'WS13 6YY', + bodies_str => '2240', + areas => ',2434,2240,', + category => 'Other', + title => 'county report', + detail => 'Test 2 Detail', + used_map => 't', + name => 'Test User', + anonymous => 'f', + state => 'closed', + confirmed => $now->ymd . ' ' . $now->hms, + lang => 'en-gb', + service => '', + cobrand => 'default', + cobrand_data => '', + send_questionnaire => 't', + latitude => '52.727588', + longitude => '-1.731322', + user_id => $user1->id, + } +); + +subtest "check RSS feeds on cobrand have correct URLs for non-cobrand reports" => sub { + $mech->host('lichfielddc.fixmystreet.com'); + $mech->get_ok("/rss/area/Lichfield"); + + my $expected1 = mySociety::Config::get('BASE_URL') . '/report/' . $report_to_county_council->id; + my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('lichfielddc')->new(); + my $expected2 = $cobrand->base_url . '/report/' . $report_to_council->id; + + $mech->content_contains($expected1, 'non cobrand area report point to fixmystreet.com'); + $mech->content_contains($expected2, 'cobrand area report point to cobrand url'); +}; + +$user1->problems->delete(); $user1->delete(); done_testing(); -- cgit v1.2.3