Created
November 3, 2014 20:29
-
-
Save bayendor/4c502fc6fe82c7c9e97e to your computer and use it in GitHub Desktop.
Intro to Capybara
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
describe "the idea creation process", :type => :feature do | |
it "goes to the home page" do | |
visit '/' | |
within("#session") do | |
fill_in 'Title', :with => 'great idea' | |
fill_in 'Description', :with => 'so awesome all the things' | |
end | |
click_button 'submit' | |
expect(page).to have_content 'Great Idea' | |
end | |
end | |
describe "logging into an account", :type => :feature do | |
before :each do | |
User.make(:email => 'user@example.com', :password => 'password') | |
end | |
it "signs me in" do | |
visit '/login' | |
within("#session") do | |
fill_in 'Email', :with => 'user@example.com' | |
fill_in 'Password', :with => 'password' | |
end | |
click_button 'Sign in' | |
expect(page).to have_content 'Success' | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment