Skip to content

Instantly share code, notes, and snippets.

@zmariscal
Created July 20, 2019 19:18
Show Gist options
  • Save zmariscal/936c97811017f90b3f45201af88d11fb to your computer and use it in GitHub Desktop.
Save zmariscal/936c97811017f90b3f45201af88d11fb to your computer and use it in GitHub Desktop.
Optional org_admin
## user within a shared context
let(:options) { opts || {} }
let(:access) { options[:access] || {} }
let(:role) { options.fetch(:role, "standard") }
let(:org_admin) { options.fetch(:org_admin, false) }
let!(:membership) { current_user.account_memberships.create!(account: account, role: role, organization_administrator: access[:org_admin]) }
## shared context in spec
context "as an admin insight core user" do
include_context "insight core user", role: :power, org_admin: :true
include_examples "can invite new account members"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment