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
|
||||
|
||||
it "signs me in" do
|
||||
visit '/sessions/new'
|
||||
within("#session") do
|
||||
fill_in 'Login', :with => 'user@example.com'
|
||||
fill_in 'Password', :with => 'password'
|
||||
end
|
||||
click_link 'Sign in'
|
||||
page.should have_content 'Success'
|
||||
end
|
||||
end
|
||||
```
|
||||
|
@ -131,21 +133,25 @@ feature "Signing up" do
|
|||
end
|
||||
|
||||
scenario "Signing in with correct credentials" do
|
||||
visit '/sessions/new'
|
||||
within("#session") do
|
||||
fill_in 'Login', :with => 'user@example.com'
|
||||
fill_in 'Password', :with => 'caplin'
|
||||
end
|
||||
click_link 'Sign in'
|
||||
page.should have_content 'Success'
|
||||
end
|
||||
|
||||
given(:other_user) { User.make(:email => 'other@example.com', :password => 'rous') }
|
||||
|
||||
scenario "Signing in as another user" do
|
||||
visit '/sessions/new'
|
||||
within("#session") do
|
||||
fill_in 'Login', :with => other_user.email
|
||||
fill_in 'Password', :with => other_user.password
|
||||
end
|
||||
click_link 'Sign in'
|
||||
page.should have_content 'Invalid email or password'
|
||||
end
|
||||
end
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue