Skip to content

Commit

Permalink
Item14237: Fix for broken behavior
Browse files Browse the repository at this point in the history
Fix to PlackTestCase now correctly returns Sandbox web default topic
instead of Main.WebHome for test_probe whereas test_Simple still works
with the latter.
  • Loading branch information
vrurg committed May 13, 2018
1 parent a2384af commit 4b1d415
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions UnitTestContrib/test/unit/PlackViewTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,24 @@ sub clientSimple {
my $this = shift;
my %args = @_;

my $test = $args{plackTestObj};
my $test = $args{plackTestObj};
my $testName = $args{testParams}{name};

my $expected =
'<h1 id="Welcome_to_the_Main_web"> Welcome to the Main web </h1>
Congratulations, you have finished installing Foswiki.
<p>';
state $expected = {
'Simple' =>
'<h1 id="Welcome_to_the_Main_web"> Welcome to the Main web </h1> Congratulations, you have finished installing Foswiki. <p>',
'probe' =>
'<h1 id="Welcome_to_the_Sandbox_web"> Welcome to the Sandbox web </h1> The <b>Sandbox</b> web is the sandbox you can use for testing. Everybody is welcome to add or delete some stuff. It is recommended to walk through the <a href="/view/System/TwentyMinuteTutorial">TwentyMinuteTutorial</a>',
};

$this->assert( defined $expected->{$testName},
"Unexpected test name `" . $testName . "'" );

my $res = $test->request( GET "/" );

my $content = $res->content;

$this->assert_html_matches( $expected, $content );
$this->assert_html_matches( $expected->{$testName}, $content );
}

1;
Expand Down

0 comments on commit 4b1d415

Please sign in to comment.