adding a lot of inline documentation to code for rdocs

This commit is contained in:
Ryan Bates
2009-11-17 16:56:16 -08:00
parent 072cb0f2de
commit b9227eb971
4 changed files with 188 additions and 20 deletions

View File

@@ -61,6 +61,7 @@ describe CanCan::ControllerAdditions do
end
it "should perform authorization using controller action and loaded model" do
stub(@controller).current_user { :current_user }
@controller.instance_variable_set(:@ability, :some_resource)
stub(@controller).params { {:controller => "abilities", :action => "show"} }
stub(@controller).can?(:show, :some_resource) { false }
@@ -70,6 +71,7 @@ describe CanCan::ControllerAdditions do
end
it "should perform authorization using controller action and non loaded model" do
stub(@controller).current_user { :current_user }
stub(@controller).params { {:controller => "abilities", :action => "show"} }
stub(@controller).can?(:show, Ability) { false }
lambda {