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