diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-02-01 15:28:08 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-02-04 06:53:02 +0000 |
commit | 488a8f21a0c1bc2b9501c9d94d69db56cccd80ae (patch) | |
tree | 68becf501e9492466a80015e8ace9a7fb1557cfa /t/app/controller/rss.t | |
parent | 3e0d12e8584d132b573f536ab5cd01e24241827b (diff) | |
parent | 28aa1dd7fb1c9bc93aa204afae67cf68fe36ee6b (diff) |
Merge remote branch 'origin/zurich'
Conflicts:
bin/open311-populate-service-list
bin/send-comments
bin/update-all-reports
conf/crontab.ugly
db/schema.sql
perllib/FixMyStreet/App/Controller/Admin.pm
perllib/FixMyStreet/App/Controller/Report/New.pm
perllib/FixMyStreet/App/Controller/Reports.pm
perllib/FixMyStreet/Cobrand/Default.pm
perllib/FixMyStreet/Cobrand/LichfieldDC.pm
perllib/FixMyStreet/DB/Result/Open311conf.pm
perllib/FixMyStreet/DB/Result/Problem.pm
perllib/FixMyStreet/DB/ResultSet/Problem.pm
perllib/FixMyStreet/SendReport.pm
perllib/FixMyStreet/SendReport/Email.pm
perllib/FixMyStreet/SendReport/Open311.pm
perllib/Open311/GetServiceRequestUpdates.pm
perllib/Open311/PopulateServiceList.pm
t/app/controller/report_new.t
t/app/controller/rss.t
templates/web/bromley/report/display.html
templates/web/default/admin/council_contacts.html
templates/web/default/common_header_tags.html
templates/web/default/dashboard/index.html
templates/web/default/front/stats.html
templates/web/default/report/_main.html
templates/web/default/report/update-form.html
templates/web/emptyhomes/index.html
templates/web/emptyhomes/report/display.html
templates/web/emptyhomes/report/new/councils_text_all.html
templates/web/emptyhomes/reports/body.html
templates/web/emptyhomes/reports/index.html
templates/web/fixmystreet/report/new/fill_in_details_form.html
templates/web/fixmystreet/report/update-form.html
web/cobrands/fixmystreet/fixmystreet.js
web/js/fixmystreet.js
Diffstat (limited to 't/app/controller/rss.t')
-rw-r--r-- | t/app/controller/rss.t | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/t/app/controller/rss.t b/t/app/controller/rss.t index 456067e6c..f04a17151 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', @@ -113,6 +113,68 @@ $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'); +}; + $mech->delete_user( $user1 ); done_testing(); |