Created
October 20, 2008 23:28
-
-
Save Peeja/18211 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
# config.include(HaveTagExtensions) to do things like: | |
# | |
# response.should have_tag("form input#email") do | |
# with_value("[email protected]") | |
# end | |
# | |
# response.should have_tag("strong") do | |
# with_text("Important!") | |
# end | |
module HaveTagExtensions | |
def with_text(text) | |
with_tag("*", text) | |
end | |
def method_missing(id, *args) | |
if id.to_s =~ /^with_([a-z]+)$/ | |
with_tag("[#{$1}=?]", *args) | |
else | |
super | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment