Skip to content

Instantly share code, notes, and snippets.

@bayendor
Created November 3, 2014 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bayendor/4c502fc6fe82c7c9e97e to your computer and use it in GitHub Desktop.
Save bayendor/4c502fc6fe82c7c9e97e to your computer and use it in GitHub Desktop.
Intro to Capybara
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