Created
May 17, 2012 04:32
-
-
Save rimian/2716379 to your computer and use it in GitHub Desktop.
best practice request specs
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
require 'spec_helper' | |
describe "request spec test" do | |
before(:each) do | |
#log into devise (testing sub domains with capybara work around) | |
create_user() | |
sign_in | |
click_link_to_a_page() | |
end | |
it "creates a thing", :js => true do | |
fill_in 'input', :with => 'foo' | |
click_button() | |
page.should have_content('foo') | |
end | |
it "deletes a thing", :js => true do | |
fill_in 'input', :with => 'foo' | |
click_button() | |
click_button('destroy') | |
page.should_not have_content('foo') | |
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
require 'spec_helper' | |
describe "request spec test" do | |
before(:each) do | |
#log into devise (testing sub domains with capybara work around) | |
create_user() | |
sign_in | |
click_link_to_a_page() | |
end | |
it "creates and deletes a thing", :js => true do | |
fill_in 'input', :with => 'foo' | |
click_button() | |
page.should have_content('foo') | |
click_button('destroy') | |
page.should_not have_content('foo') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment