spec/authority/abilities_spec.rb in authority-2.6.0 vs spec/authority/abilities_spec.rb in authority-2.7.0
- old
+ new
@@ -44,9 +44,30 @@
end
end
+ describe "authorizer=" do
+
+ let(:test_class) { Class.new {include Authority::Abilities} }
+
+ it "has a class attribute setter" do
+ expect(test_class).to respond_to(:authorizer=)
+ end
+
+ it "sets authorizer" do
+ test_class.authorizer = ExampleResourceAuthorizer
+ expect(test_class.authorizer).to eq(ExampleResourceAuthorizer)
+ end
+
+ it "also sets authorizer_name" do
+ test_class.authorizer_name = 'FooAuthorizer'
+ test_class.authorizer = ExampleResourceAuthorizer
+ expect(test_class.authorizer_name).to eq("ExampleResourceAuthorizer")
+ end
+
+ end
+
describe "authorizer" do
it "constantizes the authorizer name as the authorizer" do
resource_class.instance_variable_set(:@authorizer, nil)
resource_class.authorizer_name.should_receive(:constantize)