diff options
Diffstat (limited to 't/app/uri_for.t')
-rw-r--r-- | t/app/uri_for.t | 57 |
1 files changed, 6 insertions, 51 deletions
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' ), |