Sha256: 3f0a808f0b226405fa68cf4b963286c767c88c5ddc4beaedcb744a51ed83bb17

Contents?: true

Size: 1.18 KB

Versions: 10

Compression:

Stored size: 1.18 KB

Contents

# @example
#   I log in as "archivist1@example.com"
# @example
#   I am logged in as "archivist1@example.com"
Given /^I (?:am )?log(?:ged)? in as "([^\"]*)"$/ do |email|
  # Given %{a User exists with a Login of "#{login}"}
  user = User.create(:email => email, :password => "password", :password_confirmation => "password")
  User.find_by_email(email).should_not be_nil
  visit destroy_user_session_path
  visit new_user_session_path
  fill_in "Email", :with => email 
  fill_in "Password", :with => "password"
  click_button "Sign in"
  step %{I should see a link to "my account info" with label "#{email}"} 
  step %{I should see a link to "logout"} 
end

Given /^I am logged in as "([^\"]*)" with "([^\"]*)" permissions$/ do |login,permission_group|
  Given %{I am logged in as "#{login}"}
  RoleMapper.roles(login).should include permission_group
end

Given /^I am a superuser$/ do
  step %{I am logged in as "bigwig@example.com"}
  bigwig_id = User.find_by_email("bigwig@example.com").id
  superuser = Superuser.create(:id => 20, :user_id => bigwig_id)
  visit superuser_path
end

Given /^I am not logged in$/ do
  step %{I log out}
end

Given /^I log out$/ do
  visit destroy_user_session_path
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hydra-head-4.0.0.rc4 test_support/features/step_definitions/user_steps.rb
hydra-head-4.0.0.rc3 test_support/features/step_definitions/user_steps.rb
hydra-head-4.0.0.rc2 test_support/features/step_definitions/user_steps.rb
hydra-head-3.3.0 test_support/features/step_definitions/user_steps.rb
hydra-head-3.2.2 test_support/features/step_definitions/user_steps.rb
hydra-head-3.2.1 test_support/features/step_definitions/user_steps.rb
hydra-head-3.2.0 test_support/features/step_definitions/user_steps.rb
hydra-head-3.2.0.pre3 test_support/features/step_definitions/user_steps.rb
hydra-head-3.2.0.pre2 test_support/features/step_definitions/user_steps.rb
hydra-head-3.2.0.pre1 test_support/features/step_definitions/user_steps.rb