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



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

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