@@ -52,9 +52,7 @@ Then(/^I log in with the email "(.*?)" and password "(.*?)"$/) do |arg1, arg2| |
||
| 52 | 52 |
fill_in "user_email", :with => arg1 |
| 53 | 53 |
fill_in "user_password", :with => arg2 |
| 54 | 54 |
click_button "Submit" |
| 55 |
- user = User.find_by_email(arg1) |
|
| 56 |
- login_as user, scope: :user |
|
| 57 |
- visit root_path |
|
| 55 |
+ page.driver.submit :post, new_user_session_path(:user => {email: arg1, password: arg2}), {}
|
|
| 58 | 56 |
end |
| 59 | 57 |
|
| 60 | 58 |
# METHODS |
@@ -13,7 +13,8 @@ Feature: User Account |
||
| 13 | 13 |
When I go to the login page |
| 14 | 14 |
Then I should see "Sign In" |
| 15 | 15 |
And I log in with the email "monty_cantsin@canada.com" and password "12345678" |
| 16 |
- Then I should see "Monty Cantsin" |
|
| 16 |
+ Then I should see "Signed in successfully" |
|
| 17 |
+ And I should see "Monty Cantsin" |
|
| 17 | 18 |
And I should see "Logout" |
| 18 | 19 |
|
| 19 | 20 |
Scenario: Registered user logout |