Sha256: 5859e4b2f09a058670f563b0e3eaac8ee7d049692d5d23937ffe51df7b0a3611
Contents?: true
Size: 1.56 KB
Versions: 9
Compression:
Stored size: 1.56 KB
Contents
module AuthorizationHelpers module AccountAdminExampleGroup extend ActiveSupport::Concern included do let(:account) { Factory(:account) } before { sign_in_as_admin_of_account(account) } end end module AccountMemberExampleGroup extend ActiveSupport::Concern included do let(:account) { Factory(:account) } before { sign_in_as_non_admin_of_account(account) } end end module ProjectAdminExampleGroup extend ActiveSupport::Concern included do let(:account) { Factory(:account) } let(:project) { Factory(:project, :account => account) } before { sign_in_as_admin_of_project(project) } end end module ProjectMemberExampleGroup extend ActiveSupport::Concern included do let(:account) { Factory(:account) } let(:project) { Factory(:project, :account => account) } before { sign_in_as_non_admin_of_project(project) } end end module UserExampleGroup extend ActiveSupport::Concern included do let(:user) { Factory(:email_confirmed_user) } before { sign_in_as(user) } end end end RSpec.configure do |config| config.include AuthorizationHelpers::AccountAdminExampleGroup, :as => :account_admin config.include AuthorizationHelpers::AccountMemberExampleGroup, :as => :account_member config.include AuthorizationHelpers::ProjectAdminExampleGroup, :as => :project_admin config.include AuthorizationHelpers::ProjectMemberExampleGroup, :as => :project_member config.include AuthorizationHelpers::UserExampleGroup, :as => :user end
Version data entries
9 entries across 9 versions & 1 rubygems