Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding current_ability to helper methods - closes #361

  • Loading branch information...
commit 4e4c5a9a7f17710823b5ac16b66696717deffe54 1 parent dde88c9
@ryanb authored
View
2  lib/cancan/controller_additions.rb
@@ -286,7 +286,7 @@ def cancan_skipper
def self.included(base)
base.extend ClassMethods
- base.helper_method :can?, :cannot?
+ base.helper_method :can?, :cannot?, :current_ability
end
# Raises a CanCan::AccessDenied exception if the current_ability cannot
View
2  spec/cancan/controller_additions_spec.rb
@@ -6,7 +6,7 @@
@controller = @controller_class.new
stub(@controller).params { {} }
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)
end
Please sign in to comment.
Something went wrong with that request. Please try again.