Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item14260: Broke the unit tests
And discovered some messages were reversed.
  • Loading branch information
gac410 committed Dec 29, 2016
1 parent e886b6d commit 008bf0d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
17 changes: 13 additions & 4 deletions UnitTestContrib/test/unit/RegisterTests.pm
Expand Up @@ -2929,7 +2929,10 @@ sub verify_registerVerifyOKApproved {
$this->assert_matches( qr/^\| WalterPigeon \|/ms, $regReport );
$regReport =
Foswiki::Func::expandCommonVariables('%PENDINGREGISTRATIONS{approval}%');
$this->assert_str_equals( '', $regReport );
$this->assert_str_equals(
'<div class="foswikiAlert">Registration approval is not enabled.</div>',
$regReport
);

$this->createNewFoswikiSession( $Foswiki::cfg{DefaultUserLogin}, $query );
$this->{session}->net->setMailHandler( \&FoswikiFnTestCase::sentMail );
Expand Down Expand Up @@ -2992,7 +2995,9 @@ sub verify_registerVerifyOKApproved {
$this->createNewFoswikiSession( $Foswiki::cfg{AdminUserLogin}, $query );
$regReport = Foswiki::Func::expandCommonVariables(
'%PENDINGREGISTRATIONS{verification}%');
$this->assert_str_equals( '', $regReport );
$this->assert_str_equals(
'<div class="foswikiAlert">No registrations are pending.</div>',
$regReport );
$regReport =
Foswiki::Func::expandCommonVariables('%PENDINGREGISTRATIONS{approval}%');
$this->assert_matches( qr/\Q| WalterPigeon | \E/ms, $regReport );
Expand Down Expand Up @@ -3053,10 +3058,14 @@ sub verify_registerVerifyOKApproved {
$this->createNewFoswikiSession( $Foswiki::cfg{AdminUserLogin}, $query );
$regReport = Foswiki::Func::expandCommonVariables(
'%PENDINGREGISTRATIONS{verification}%');
$this->assert_str_equals( '', $regReport );
$this->assert_str_equals(
'<div class="foswikiAlert">No registrations are pending.</div>',
$regReport );
$regReport =
Foswiki::Func::expandCommonVariables('%PENDINGREGISTRATIONS{approval}%');
$this->assert_str_equals( '', $regReport );
$this->assert_str_equals(
'<div class="foswikiAlert">No registrations are pending.</div>',
$regReport );

$this->assert(
$this->{session}->topicExists(
Expand Down
4 changes: 2 additions & 2 deletions core/lib/Foswiki/Macros/PENDINGREGISTRATIONS.pm
Expand Up @@ -28,7 +28,7 @@ sub PENDINGREGISTRATIONS {
$report .= $this->_checkPendingRegistrations('Approval');
}
else {
$report .= Foswiki::Func::expandTemplate('verifyNotEnabled');
$report .= Foswiki::Func::expandTemplate('approvalNotEnabled');
}
}

Expand All @@ -39,7 +39,7 @@ sub PENDINGREGISTRATIONS {
$report .= $this->_checkPendingRegistrations('Verification');
}
else {
$report .= Foswiki::Func::expandTemplate('approvalNotEnabled');
$report .= Foswiki::Func::expandTemplate('veriyNotEnabled');
}
}

Expand Down

0 comments on commit 008bf0d

Please sign in to comment.