1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

update RSpec examples

This commit is contained in:
Joel Quenneville 2013-01-08 09:53:37 -05:00
parent 668dc3ccc0
commit af4b32aa30

View file

@ -102,11 +102,13 @@ describe "the signup process", :type => :feature do
end end
it "signs me in" do it "signs me in" do
visit '/sessions/new'
within("#session") do within("#session") do
fill_in 'Login', :with => 'user@example.com' fill_in 'Login', :with => 'user@example.com'
fill_in 'Password', :with => 'password' fill_in 'Password', :with => 'password'
end end
click_link 'Sign in' click_link 'Sign in'
page.should have_content 'Success'
end end
end end
``` ```
@ -131,21 +133,25 @@ feature "Signing up" do
end end
scenario "Signing in with correct credentials" do scenario "Signing in with correct credentials" do
visit '/sessions/new'
within("#session") do within("#session") do
fill_in 'Login', :with => 'user@example.com' fill_in 'Login', :with => 'user@example.com'
fill_in 'Password', :with => 'caplin' fill_in 'Password', :with => 'caplin'
end end
click_link 'Sign in' click_link 'Sign in'
page.should have_content 'Success'
end end
given(:other_user) { User.make(:email => 'other@example.com', :password => 'rous') } given(:other_user) { User.make(:email => 'other@example.com', :password => 'rous') }
scenario "Signing in as another user" do scenario "Signing in as another user" do
visit '/sessions/new'
within("#session") do within("#session") do
fill_in 'Login', :with => other_user.email fill_in 'Login', :with => other_user.email
fill_in 'Password', :with => other_user.password fill_in 'Password', :with => other_user.password
end end
click_link 'Sign in' click_link 'Sign in'
page.should have_content 'Invalid email or password'
end end
end end
``` ```