2009-05-22 23:14:40 +02:00
|
|
|
Given /^I have logged in as "(.*)" with password "(.*)"$/ do |username, password|
|
2009-04-13 22:26:20 +02:00
|
|
|
visit login_path
|
2010-02-02 22:52:32 +01:00
|
|
|
fill_in "Login", :with => username
|
|
|
|
|
fill_in "Password", :with => password
|
|
|
|
|
click_button
|
2010-05-05 13:15:00 +02:00
|
|
|
selenium.wait_for_page_to_load(5000)
|
2010-02-02 22:52:32 +01:00
|
|
|
response.should contain(/Login successful/)
|
2009-05-22 23:14:40 +02:00
|
|
|
@current_user = User.find_by_login(username)
|
2009-04-13 22:26:20 +02:00
|
|
|
end
|
2009-04-17 08:56:11 +02:00
|
|
|
|
2009-05-22 23:14:40 +02:00
|
|
|
When /^I submit the login form as user "([^\"]*)" with password "([^\"]*)"$/ do |username, password|
|
|
|
|
|
fill_in 'Login', :with => username
|
|
|
|
|
fill_in 'Password', :with => password
|
2009-04-17 08:56:11 +02:00
|
|
|
click_button
|
2010-02-02 22:52:32 +01:00
|
|
|
end
|