mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-25 08:34:08 +01:00
Add login backdoor to speed up the cucumber test suite
This commit is contained in:
parent
b87326acd7
commit
2c5aff3b36
3 changed files with 43 additions and 10 deletions
|
|
@ -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|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue