diff options
Diffstat (limited to 't/app')
-rw-r--r-- | t/app/controller/report_new.t | 10 | ||||
-rw-r--r-- | t/app/helpers/send_email.t | 17 | ||||
-rw-r--r-- | t/app/uri_for.t | 57 |
3 files changed, 15 insertions, 69 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t index 722c3c39c..818f9e625 100644 --- a/t/app/controller/report_new.t +++ b/t/app/controller/report_new.t @@ -955,7 +955,7 @@ subtest "check that a lat/lon off coast leads to /around" => sub { for my $test ( { desc => 'user title not set if not bromley problem', - host => 'http://www.fixmystreet.com', + host => 'www.fixmystreet.com', postcode => 'EH99 1SP', fms_extra_title => '', extra => undef, @@ -963,7 +963,7 @@ for my $test ( }, { desc => 'title shown for bromley problem on main site', - host => 'http://www.fixmystreet.com', + host => 'www.fixmystreet.com', postcode => 'BR1 3UH', fms_extra_title => 'MR', extra => [ @@ -978,7 +978,7 @@ for my $test ( { desc => 'title, first and last name shown for bromley problem on cobrand', - host => 'http://bromley.fixmystreet.com', + host => 'bromley.fixmystreet.com', postcode => 'BR1 3UH', first_name => 'Test', last_name => 'User', @@ -1093,7 +1093,7 @@ for my $test ( subtest 'user title not reset if no user title in submission' => sub { $mech->log_out_ok; - $mech->host( 'http://fixmystreet.com' ); + $mech->host( 'fixmystreet.com' ); my $user = $mech->log_in_ok( 'userwithtitle@example.com' ); @@ -1174,7 +1174,7 @@ SKIP: { ) { subtest $test->{ desc } => sub { my $test_email = 'test-22@example.com'; - $mech->host( 'http://lichfielddc.fixmystreet.com/' ); + $mech->host( 'lichfielddc.fixmystreet.com' ); $mech->clear_emails_ok; $mech->log_out_ok; diff --git a/t/app/helpers/send_email.t b/t/app/helpers/send_email.t index 3067d90f3..14c7d363b 100644 --- a/t/app/helpers/send_email.t +++ b/t/app/helpers/send_email.t @@ -9,23 +9,14 @@ BEGIN { FixMyStreet->test_mode(1); } -use Test::More tests => 6; +use Test::More tests => 5; + +use Catalyst::Test 'FixMyStreet::App'; use Email::Send::Test; use Path::Class; -use_ok 'FixMyStreet::App'; -my $c = FixMyStreet::App->new( - { - request => Catalyst::Request->new( - { - base => URI->new('http://fixmystreet.com/'), - uri => URI->new('http://fixmystreet.com/') - } - ), - } -); -$c->setup_request(); +my $c = ctx_request("/"); # set some values in the stash $c->stash->{foo} = 'bar'; diff --git a/t/app/uri_for.t b/t/app/uri_for.t index eecf30e32..bf965fb62 100644 --- a/t/app/uri_for.t +++ b/t/app/uri_for.t @@ -4,7 +4,7 @@ use warnings; use Test::More; # FIXME Should this be here? A better way? uri_for varies by map. -use Test::WWW::Mechanize::Catalyst 'FixMyStreet::App'; +use Catalyst::Test 'FixMyStreet::App'; FixMyStreet::Map::set_map_class(); # structure of these tests borrowed from '/t/aggregate/unit_core_uri_for.t' @@ -15,43 +15,9 @@ use URI; use_ok('FixMyStreet::App'); -my $fms_c = FixMyStreet::App->new( - { - request => Catalyst::Request->new( - { - base => URI->new('http://www.fixmystreet.com/'), - uri => URI->new('http://www.fixmystreet.com/test_namespace') - } - ), - namespace => 'test_namespace', - } -); - -my $fgm_c = FixMyStreet::App->new( - { - request => Catalyst::Request->new( - { - base => URI->new('http://www.fiksgatami.no/'), - uri => URI->new('http://www.fiksgatami.no/test_namespace') - } - ), - namespace => 'test_namespace', - } -); - -my $reh_en_c = FixMyStreet::App->new( - { - request => Catalyst::Request->new( - { - base => URI->new('http://reportemptyhomes.com/'), - uri => URI->new('http://reportemptyhomes.com/test_namespace') - } - ), - namespace => 'test_namespace', - } -); -$reh_en_c->setup_request(); - +my $fms_c = ctx_request('http://www.fixmystreet.com/'); +my $fgm_c = ctx_request('http://www.fiksgatami.no/'); +my $reh_en_c = ctx_request('http://reportemptyhomes.com/'); is( $fms_c->uri_for('/bar/baz') . "", @@ -61,7 +27,7 @@ is( is( $fms_c->uri_for('') . "", - 'http://www.fixmystreet.com/test_namespace', + 'http://www.fixmystreet.com/', 'URI for namespace' ); @@ -90,18 +56,7 @@ SKIP: { # instantiate this here otherwise sets locale to cy and breaks test # above - my $reh_cy_c = FixMyStreet::App->new( - { - request => Catalyst::Request->new( - { - base => URI->new('http://cy.reportemptyhomes.com/'), - uri => URI->new('http://cy.reportemptyhomes.com/test_namespace') - } - ), - namespace => 'test_namespace', - } - ); - $reh_cy_c->setup_request(); + my $reh_cy_c = ctx_request('http://cy.reportemptyhomes.com/'); like( $reh_cy_c->uri_for_email( '/foo' ), |