tracks/features/step_definitions/login_steps.rb
Reinier Balt 2073f84cd8 update cucumber and refactor some of the stories
inspired by the railscasts about cucumber. Also fix a problem with ZenTest on case sensitive platforms
2009-05-22 23:14:40 +02:00

14 lines
No EOL
497 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 "Sign in"
response.body.should =~ /Login successful/m
@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