adding current_ability to helper methods - closes #361
This commit is contained in:
parent
dde88c92b7
commit
4e4c5a9a7f
|
@ -286,7 +286,7 @@ module CanCan
|
||||||
|
|
||||||
def self.included(base)
|
def self.included(base)
|
||||||
base.extend ClassMethods
|
base.extend ClassMethods
|
||||||
base.helper_method :can?, :cannot?
|
base.helper_method :can?, :cannot?, :current_ability
|
||||||
end
|
end
|
||||||
|
|
||||||
# Raises a CanCan::AccessDenied exception if the current_ability cannot
|
# Raises a CanCan::AccessDenied exception if the current_ability cannot
|
||||||
|
|
|
@ -6,7 +6,7 @@ describe CanCan::ControllerAdditions do
|
||||||
@controller = @controller_class.new
|
@controller = @controller_class.new
|
||||||
stub(@controller).params { {} }
|
stub(@controller).params { {} }
|
||||||
stub(@controller).current_user { :current_user }
|
stub(@controller).current_user { :current_user }
|
||||||
mock(@controller_class).helper_method(:can?, :cannot?)
|
mock(@controller_class).helper_method(:can?, :cannot?, :current_ability)
|
||||||
@controller_class.send(:include, CanCan::ControllerAdditions)
|
@controller_class.send(:include, CanCan::ControllerAdditions)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user