From c8447ee320407a0542106cf92d20d72b95452b19 Mon Sep 17 00:00:00 2001 From: Hakim Cassimally Date: Tue, 17 Dec 2013 14:46:31 +0000 Subject: Test for admin_base_url in RS::Problem Test that the slash is added in correct place (the base URL should not have its own trailing slash). --- t/app/controller/admin.t | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 't/app/controller/admin.t') diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t index 4970821a8..e369968b4 100644 --- a/t/app/controller/admin.t +++ b/t/app/controller/admin.t @@ -1228,6 +1228,17 @@ subtest "Test setting a report from unconfirmed to something else doesn't cause $mech->get_ok("/report/$report_id"); }; +subtest "Check admin_base_url" => sub { + my $rs = FixMyStreet::App->model('DB::Problem'); + my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($report->cobrand)->new(); + + is (FixMyStreet::App->model('DB::Problem')->get_admin_url( + $cobrand, + $report), + (sprintf 'https://secure.mysociety.org/admin/bci/report_edit/%d', $report_id), + 'get_admin_url OK'); +}; + $mech->delete_user( $user ); $mech->delete_user( $user2 ); $mech->delete_user( $user3 ); -- cgit v1.2.3