Given /^I am not authenticated$/ do visit('/users/sign_out') # ensure that at least end Given /^I have one\s+user "([^\"]*)" with password "([^\"]*)" and login "([^\"]*)"$/ do |email, password, login| User.new(:email => email, :login => login, :password => password, :password_confirmation => password).save! end Given /^I am a new, authenticated user$/ do email = 'testing@man.net' login = 'Testing man' password = 'secretpass' Given %{I have one user "#{email}" with password "#{password}" and login "#{login}"} And %{I go to login} And %{I fill in "user_email" with "#{email}"} And %{I fill in "user_password" with "#{password}"} And %{I press "Sign in"} end