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



9
10
11
12
13
14
15
# File 'lib/spree/testing_support/authorization_helpers.rb', line 9

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