Permalink
Browse files

adding current_ability to helper methods - closes #361

  • Loading branch information...
1 parent dde88c9 commit 4e4c5a9a7f17710823b5ac16b66696717deffe54 @ryanb committed May 17, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/cancan/controller_additions.rb
  2. +1 −1 spec/cancan/controller_additions_spec.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
@@ -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

0 comments on commit 4e4c5a9

Please sign in to comment.