adding current_ability to helper methods - closes #361

This commit is contained in:
Ryan Bates 2011-05-17 13:21:11 -04:00
parent dde88c92b7
commit 4e4c5a9a7f
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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