Skip to content

Commit

Permalink
Add a test for finding a link in a meta refresh tag
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Apr 3, 2019
1 parent 14ce0f2 commit 307a9ae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Revision history for WWW::Mechanize

{{$NEXT}}
[TESTS]
- Add a test for finding a link in a meta refresh tag

1.91 2019-01-10 18:44:33Z
[ENHANCEMENTS]

- Don't install Perl::Critic and Perl::Tidy to run user tests (GH#268)
(Julien Fiegehenn)
- Remove redundant PodSyntaxTests (GH#265) (Andrew Grangaard)
Expand Down
9 changes: 8 additions & 1 deletion t/find_link.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

use warnings;
use strict;
use Test::More tests => 65;

use Test::More;
use URI::file;

BEGIN {
Expand Down Expand Up @@ -154,3 +155,9 @@ $x = $mech->find_link( text_regex => qr/click/i);
isa_ok( $x, 'WWW::Mechanize::Link' );
is( $x->[0], 'http://www.yahoo.com/', 'Got js url link' );
is( $x->url, 'http://www.yahoo.com/', 'Got js url link' );
$mech->get( URI::file->new_abs('t/refresh.html') );
my $link = $mech->find_link( tag => 'meta' );
is( $link->url, 'http://www.mysite.com/', 'got link from meta tag via tag search' );
done_testing();
3 changes: 3 additions & 0 deletions t/refresh.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<body>
<meta content="0; url='http://www.mysite.com/'" http-equiv="refresh">
</body>

0 comments on commit 307a9ae

Please sign in to comment.