Created
November 23, 2010 09:29
-
-
Save csshsh/711513 to your computer and use it in GitHub Desktop.
This file contains 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
feature "Main page" do | |
background do | |
create_user :login => "jdoe" | |
login_as "jdoe" | |
end | |
scenario "should show existing quotes" do | |
create_quote :text => "The language of friendship is not words, but meanings", | |
:author => "Henry David Thoreau" | |
visit "/" | |
page.should have_css(".quote", :count => 1) | |
within(:css, ".quote") do | |
page.should have_css(".text", :text => "The language of friendship is not words, but meanings") | |
page.should have_css(".author", :text => "Henry David Thoreau") | |
end | |
end | |
end |
This file contains 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 ActionController | |
class IntegrationTest | |
include Capybara | |
class << self | |
alias :background :setup | |
alias :scenario :test | |
end | |
end | |
end | |
def feature(name, &block) | |
klazz_name = "#{name.titleize.gsub(/[^a-zA-Z0-9]+/, '')}FeatureTest" | |
klazz = Class.new(ActionController::IntegrationTest) | |
Object.const_set(klazz_name, klazz) | |
klazz.class_eval(&block) if block_given? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment