Sha256: 4c7740e47427b612f607eb8b6d730e87099ee587d84b017acff790e136e425e8

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

# @example
#   I log in as "archivist1"
# @example
#   I am logged in as "archivist1"
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"}
  bigwig_id = User.find_by_email("BigWig@BigWig.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

3 entries across 3 versions & 1 rubygems

Version Path
hydra-head-3.0.0pre3 test_support/features/step_definitions/user_steps.rb
hydra-head-3.0.0pre2 test_support/features/step_definitions/user_steps.rb
hydra-head-3.0.0pre1 test_support/features/step_definitions/user_steps.rb