Sha256: 30ce771e3a2c94840f96531eaf962b53228c1ee219b3015403ff109ae3a90c6d

Contents?: true

Size: 1.18 KB

Versions: 18

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"
  Then %{I should see a link to "my account info" with label "#{email}"} 
  And %{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
  Given %{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
  Given %{I log out}
end

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
hydra-head-3.1.5 test_support/features/step_definitions/user_steps.rb
hydra-head-3.1.4 test_support/features/step_definitions/user_steps.rb
hydra-head-3.1.3 test_support/features/step_definitions/user_steps.rb
hydra-head-3.1.2 test_support/features/step_definitions/user_steps.rb
hydra-head-3.1.1 test_support/features/step_definitions/user_steps.rb
hydra-head-3.1.0 test_support/features/step_definitions/user_steps.rb
hydra-head-3.1.0.rc2 test_support/features/step_definitions/user_steps.rb
hydra-head-3.1.0.rc1 test_support/features/step_definitions/user_steps.rb
hydra-head-3.1.0.pre5 test_support/features/step_definitions/user_steps.rb
hydra-head-3.1.0.pre4 test_support/features/step_definitions/user_steps.rb
hydra-head-3.1.0.pre3 test_support/features/step_definitions/user_steps.rb
hydra-head-3.0.1 test_support/features/step_definitions/user_steps.rb
hydra-head-3.1.0.pre2 test_support/features/step_definitions/user_steps.rb
hydra-head-3.0.0 test_support/features/step_definitions/user_steps.rb
hydra-head-3.1.0.pre1 test_support/features/step_definitions/user_steps.rb
hydra-head-3.0.0.rc2 test_support/features/step_definitions/user_steps.rb
hydra-head-3.0.0.rc1 test_support/features/step_definitions/user_steps.rb
hydra-head-3.0.0pre4 test_support/features/step_definitions/user_steps.rb