Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Handle localhost.localdomain difference in test
it depends on /etc/hosts
  • Loading branch information
rwstauner committed Nov 23, 2014
1 parent 3e3db53 commit 7c2b603
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion t/server/controller/login/openid.t
Expand Up @@ -20,6 +20,13 @@ with qw(
my $openid_server = Test::OpenID::Server->new;
my $url = $openid_server->started_ok('start server');

sub fix_localhost_uri {
my $uri = shift;
# The dev vm make it localhost, but on travis it becomes `.localdomain`.
$uri =~ s{^(\w+://localhost)\.localdomain([:/])}{$1$2};
$uri;
}

test authorization => sub {
my $self = shift;

Expand All @@ -34,7 +41,7 @@ test authorization => sub {
ok( $self->request( GET '/login/openid?' . $uri_params->query ),
'login with test URL' );

like $self->redirect_uri,
like fix_localhost_uri($self->redirect_uri),
qr{\Q$url\E/openid.server}, 'get correct OpenID server url';

$self->follow_redirect;
Expand Down

0 comments on commit 7c2b603

Please sign in to comment.