spec/authority/controller_spec.rb in authority-1.0.0 vs spec/authority/controller_spec.rb in authority-1.1.0

- old
+ new

@@ -11,13 +11,13 @@ it "should call whatever method on the controller that the configuration specifies" do # Here be dragons! @fake_exception = Exception.new @sample_controller = SampleController.new - # If a callback is passed to a controller's `rescue_from` method as the value for + # If a callback is passed to a controller's `rescue_from` method as the value for # the `with` option (like `SomeController.rescue_from FooException, :with => some_callback`), - # Rails will use ActiveSupport's `Proc#bind` to ensure that when the proc refers to + # Rails will use ActiveSupport's `Proc#bind` to ensure that when the proc refers to # `self`, it will be the controller, not the proc itself. # I need this callback's `self` to be the controller for the purposes of # this test, so I'm stealing that behavior. @callback = Authority::Controller.security_violation_callback.bind(@sample_controller) @@ -54,11 +54,11 @@ it "should allow the child class to edit the controller action map without affecting the parent class" do DummyController.authority_action :erase => 'delete' ExampleController.authority_action_map[:erase].should be_nil end end - + end describe "DSL (class) methods" do it "should allow specifying the model to protect" do ExampleController.authorize_actions_for AbilityModel @@ -81,11 +81,11 @@ ExampleController.authority_action_map[:smite].should eq('delete') end end describe "instance methods" do - before :each do + before :each do @user = User.new @controller = ExampleController.new @controller.stub!(:action_name).and_return(:edit) @controller.stub!(Authority.configuration.user_method).and_return(@user) end @@ -136,6 +136,5 @@ end end end end -