tracks/features/step_definitions/login_steps.rb
Reinier Balt 43440eaf33 add cucumber for integration testing and add a feature for statistics
refactor some stuff to support testing statistisc
2009-04-13 22:26:20 +02:00

9 lines
347 B
Ruby

Given /^I am logged in$/ do
@current_user = User.create!(:login => "testuser", :password => "secret", :password_confirmation => "secret")
@current_user.create_preference
visit login_path
fill_in "login", :with => "testuser"
fill_in "password", :with => "secret"
click_button "Sign in"
response.body.should =~ /Login successful/m
end