Sha256: beba5a5c61a3b159dc4a36ba83fe86c2974e6f23eb717601d19dc856c4c625ff

Contents?: true

Size: 1.55 KB

Versions: 129

Compression:

Stored size: 1.55 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(: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

129 entries across 129 versions & 2 rubygems

Version Path
saucy-0.16.1 spec/support/authorization_helpers.rb
saucy-0.16.0 spec/support/authorization_helpers.rb
saucy-0.15.2 spec/support/authorization_helpers.rb
saucy-0.15.1 spec/support/authorization_helpers.rb
saucy-0.15.0 spec/support/authorization_helpers.rb
saucy-0.14.5 spec/support/authorization_helpers.rb
saucy-0.14.3 spec/support/authorization_helpers.rb
saucy-0.10.10 spec/support/authorization_helpers.rb
saucy-0.14.2 spec/support/authorization_helpers.rb
saucy-0.14.1 spec/support/authorization_helpers.rb
saucy-0.14.0 spec/support/authorization_helpers.rb
saucy-0.13.3 spec/support/authorization_helpers.rb
saucy-0.13.2 spec/support/authorization_helpers.rb
saucy-0.10.9 spec/support/authorization_helpers.rb
saucy-0.10.8 spec/support/authorization_helpers.rb
saucy-0.13.1 spec/support/authorization_helpers.rb
saucy-0.13.0 spec/support/authorization_helpers.rb
saucy-0.12.5 spec/support/authorization_helpers.rb
saucy-0.12.4 spec/support/authorization_helpers.rb
saucy-0.12.3 spec/support/authorization_helpers.rb