Created
December 20, 2008 02:41
-
-
Save til/38214 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SpecPageRefresh | |
class SpecPageRefreshMatcher | |
include Merb::Test::ViewHelper | |
def matches?(response) | |
response.should have_selector('form.hidden_refresh') | |
rescue Spec::Expectations::ExpectationNotMetError | |
false | |
end | |
def failure_message | |
"Did not include auto refresh form" | |
end | |
def negative_failure_message | |
"Included auto refresh form, but should not" | |
end | |
end | |
def refresh_page | |
SpecPageRefreshMatcher.new | |
end | |
end | |
# in the specs: | |
@response.should refresh_page | |
# and | |
@response.should_not refresh_page |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment