tracks/features/step_definitions/login_steps.rb
Reinier Balt 44c61d942a make sure login works for non-selenium cucumber
regression since my last commit
2010-05-05 19:08:41 +02:00

17 lines
571 B
Ruby

Given /^I have logged in as "(.*)" with password "(.*)"$/ do |username, password|
visit login_path
fill_in "Login", :with => username
fill_in "Password", :with => password
click_button
if response.respond_to? :selenium
selenium.wait_for_page_to_load(5000)
end
response.should contain(/Login successful/)
@current_user = User.find_by_login(username)
end
When /^I submit the login form as user "([^\"]*)" with password "([^\"]*)"$/ do |username, password|
fill_in 'Login', :with => username
fill_in 'Password', :with => password
click_button
end