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:
parent
668dc3ccc0
commit
af4b32aa30
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue