Sha256: f2d6de1499dbcce07d1a6cc3c64b3d1127921be95ae0273651fbd0743952f164

Contents?: true

Size: 1.65 KB

Versions: 3

Compression:

Stored size: 1.65 KB

Contents

Then /^I should be logged in$/ do
  response.session[:user_id].should_not be_nil
end

Then /^I should not be logged in$/ do
  response.session[:user_id].should be_nil
end

Given /^I am not logged in$/ do
  visit user_logout_path
end

Given /^I am logged in as a user$/ do
  @login = User.make(:email => 'mock_login@mockemail.com', :password =>'mock_password', :access_level => User::ACCESS_LEVEL_DISABLED + 1) 

  visit user_login_path
  fill_in "Email or Login Name", :with => 'mock_login@mockemail.com'
  fill_in "Password", :with => 'mock_password'
  click_button "Login"
end

Given /^I am logged in as an administrator$/ do
  @login = User.make(:email => 'mock_login@mockemail.com', :password =>'mock_password', :access_level => User::ACCESS_LEVEL_ADMIN) 

  visit user_login_path
  fill_in "Email or Login Name", :with => 'mock_login@mockemail.com'
  fill_in "Password", :with => 'mock_password'
  click_button "Login"
end


Given /^there is a user with email "([^\"]*)" and password "([^\"]*)"$/ do |email, password|
  @login = User.make(:email => email, :password => password, :password_confirmation => password, :access_level => 100) 
end

Given /^there is a disabled user with email "([^\"]*)" and password "([^\"]*)"$/ do |email, password|
  @login = User.make(:email => email, :password => password, :password_confirmation => password, :access_level => User::ACCESS_LEVEL_DISABLED) 
end

Then /^the remember me token should be set/ do
  warning "Cannot test cookies in webrat" #response.cookies[:auth_token].should_not be_nil
end

Then /^the remember me token should not be set/ do
  warning "Cannot test cookies in webrat"  #response.cookies[:auth_token].should be_nil
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rules_engine_users-0.0.3 rails_generators/templates/features/user/step_definitions/login_steps.rb
rules_engine_users-0.0.2 rails_generators/templates/features/user/step_definitions/login_steps.rb
rules_engine_users-0.0.1 rails_generators/templates/features/user/step_definitions/login_steps.rb