Add login backdoor to speed up the cucumber test suite

This commit is contained in:
Matt Rogers & Katrina Owen 2013-06-02 15:49:14 -05:00 committed by Matt Rogers
parent b87326acd7
commit 2c5aff3b36
3 changed files with 43 additions and 10 deletions

View file

@ -1,13 +1,7 @@
Given /^I have logged in as "(.*)" with password "(.*)"$/ do |username, password|
step "I go to the login page"
fill_in "user_login", :with => username
fill_in "user_password", :with => password
uncheck "user_noexpiry"
click_button "Sign in"
logout_regexp = @mobile_interface ? "Logout" : "Logout \(#{username}\)"
page.should have_content(logout_regexp)
@current_user = User.where(:login => username).first
user = User.where(:login => username).first
request_signin_as(user)
@current_user = user
end
When /^I submit the login form as user "([^\"]*)" with password "([^\"]*)"$/ do |username, password|