Sha256: 1e78d98d4db448767790a205ca533e2c09e4d06aa78da5f91adbe8fd14283fbf

Contents?: true

Size: 1.58 KB

Versions: 10

Compression:

Stored size: 1.58 KB

Contents

Given /^I (?:am signed in|sign in) as an admin of the "([^"]+)" project$/ do |project_name|
  project = Project.find_by_name!(project_name)
  user    = Factory(:user)
  membership = Factory(:membership, :user    => user,
                                                    :account => project.account,
                                                    :admin   => true)
  Factory(:permission, :membership => membership,
                               :project            => project)
  When %{I sign in as "#{user.email}"}
end

Given /^I am signed in as "([^"]*)" under the "([^"]*)" account$/ do |email, account_name|
  account = Factory(:account, :name => account_name)
  user    = Factory(:user, :email => email)
  membership = Factory(:membership, :user => user, :account => account)
  When %{I sign in as "#{user.email}"}
end

Given /^I am signed in as an admin of the "([^"]*)" account$/ do |account_name|
  account = Account.find_by_name!(account_name)
  user    = Factory(:user)
  Factory(:membership, :user    => user,
                               :account => account,
                               :admin   => true)
  When %{I sign in as "#{user.email}"}
end

Given /^I am signed in$/ do
  user = Factory(:user)
  When %{I sign in as "#{user.email}"}
end

When /^I authenticate as the site owner$/ do
  name, password = Saucy::Configuration.admin_username, Saucy::Configuration.admin_password
  # This is done differently in various capybara versions, you may need to change it to
  # page.driver.browser.basic_authorize - or - page.driver.basic_auth
  page.driver.basic_authorize name, password
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
saucy-0.10.10 lib/generators/saucy/features/templates/step_definitions/session_steps.rb
saucy-0.10.9 lib/generators/saucy/features/templates/step_definitions/session_steps.rb
saucy-0.10.8 lib/generators/saucy/features/templates/step_definitions/session_steps.rb
saucy-0.10.7 lib/generators/saucy/features/templates/step_definitions/session_steps.rb
saucy-0.10.6 lib/generators/saucy/features/templates/step_definitions/session_steps.rb
saucy-0.10.5 lib/generators/saucy/features/templates/step_definitions/session_steps.rb
saucy-0.10.4 lib/generators/saucy/features/templates/step_definitions/session_steps.rb
saucy-0.10.3 lib/generators/saucy/features/templates/step_definitions/session_steps.rb
saucy-0.10.2 lib/generators/saucy/features/templates/step_definitions/session_steps.rb
saucy-0.10.1 lib/generators/saucy/features/templates/step_definitions/session_steps.rb