Skip to content

Commit

Permalink
Item9601: update test for changed exception signature
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@8988 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Sep 10, 2010
1 parent 0175b60 commit 64b65cd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CommentPlugin/test/unit/CommentPlugin/CommentPluginTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -621,23 +621,25 @@ HERE
$session = Foswiki->new( $Foswiki::cfg{DefaultUserLogin}, $query );

# invoke the save handler

eval {
($responseText, $result, $stdout, $stderr) =
$this->captureWithKey( rest => $this->getUIFn('rest'), $session );
};

$this->assert($@);
$this->assert_matches(qr"OopsException\(accessdenied/topic_access", $@);
$this->assert_matches(qr"AccessControlException", $@);

# Now make sure we *can* change it, given COMMENT access
$Foswiki::cfg{Plugins}{CommentPlugin}{RequiredForSave} = 'COMMENT';

$session = Foswiki->new( $Foswiki::cfg{DefaultUserLogin}, $query );

# invoke the save handler
($responseText, $result, $stdout, $stderr) =
$this->captureWithKey( rest => $this->getUIFn('rest'), $session );
eval {
($responseText, $result, $stdout, $stderr) =
$this->captureWithKey( rest => $this->getUIFn('rest'), $session );
};
$this->assert(!$@);
$this->assert_matches(qr/Status: 200/, $responseText);

my ( $meta, $text ) =
Expand Down

0 comments on commit 64b65cd

Please sign in to comment.