Module: Spree::TestingSupport::AuthorizationHelpers::CustomAbility

Included in:
Controller, Request
Defined in:
lib/spree/testing_support/authorization_helpers.rb

Instance Method Summary collapse

Instance Method Details

#build_ability(&block) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/spree/testing_support/authorization_helpers.rb', line 5

def build_ability(&block)
  block ||= proc { |_u| can :manage, :all }
  Class.new do
    include CanCan::Ability
    define_method(:initialize, block)
  end
end