spec/authority/controller_spec.rb in authority-1.0.0.pre3 vs spec/authority/controller_spec.rb in authority-1.0.0.pre4
- old
+ new
@@ -6,11 +6,11 @@
describe Authority::Controller do
describe "when including" do
it "should specify rescuing security transgressions" do
- SampleController.should_receive(:rescue_from).with(Authority::SecurityTransgression, :with => :authority_forbidden)
+ SampleController.should_receive(:rescue_from).with(Authority::SecurityViolation, :with => :authority_forbidden)
SampleController.send(:include, Authority::Controller)
end
end
describe "after including" do
@@ -66,11 +66,11 @@
it "should check authorization on the model specified" do
@controller.should_receive(:authorize_action_for).with(AbilityModel)
@controller.send(:run_authorization_check)
end
- it "should raise a SecurityTransgression if authorization fails" do
- expect { @controller.send(:run_authorization_check) }.to raise_error(Authority::SecurityTransgression)
+ it "should raise a SecurityViolation if authorization fails" do
+ expect { @controller.send(:run_authorization_check) }.to raise_error(Authority::SecurityViolation)
end
it "should raise a MissingAction if there is no corresponding action for the controller" do
@controller.stub(:action_name).and_return('sculpt')
expect { @controller.send(:run_authorization_check) }.to raise_error(Authority::Controller::MissingAction)