Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Given /^I am a registered user with login "([^"]+)" and password "([^"]+)"$/ do |login, password|
- @login = login
- @password = password
- @current_user = Factory(:user, :email => "#{@login}@example.com", :login => @login, :password => @password, :password_confirmation => @password)
- end
- Given /^I am logged in as a registered user$/ do
- @login = "shyguy"
- @password = "test"
- @current_user = Factory(:user, :email => "#{@login}@example.com", :login => @login, :password => @password, :password_confirmation => @password)
- Given "I log in"
- end
- Given /^I am not a registered user$/ do
- end
- Given /^I log in$/ do
- visit login_path
- When %{I fill in "login" with "#{@login}"}
- When %{I fill in "password" with "#{@password}"}
- When %{I press "Go"}
- Then %{I should see "Logged in successfully"}
- end
- Given /^I am not logged in$/ do
- end
- Then /^I should be prompted to login$/ do
- response.should contain("You must login to access that part of the site")
- end
Add Comment
Please, Sign In to add comment