Skip to content

Commit

Permalink
Item14237: Additional test for expected attach page URL
Browse files Browse the repository at this point in the history
  • Loading branch information
vrurg committed May 13, 2018
1 parent b7084ff commit a2384af
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion UnitTestContrib/test/unit/PlackPostTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use Data::Dumper;
use Encoding;

use Foswiki::Class;
extends qw(Unit::PlackTestCase);
extends qw<Unit::PlackTestCase>;

use constant SIMPLE_CONTENT =>
"Simple Text File\nАбо просто текст у файлі\n";
Expand Down Expand Up @@ -82,6 +82,15 @@ sub _test_attach_simple {
$this->assert( defined($matchedA), "Attach link not found in output" );

my $attachUrl = $matchedA->{attrs}{href};

my $expectUrl = $app->getScriptUrlPath( $web, $topic, "attach" );
$this->assert_str_contains( $expectUrl, $attachUrl,
"Attach URL ("
. $attachUrl
. ") doesn't point back to view request web/topic ("
. $expectUrl
. ")" );

$res = $test->request( GET $attachUrl);
$content = $res->content;

Expand Down

0 comments on commit a2384af

Please sign in to comment.