spec/zertico/service_spec.rb in zertico-0.5.5 vs spec/zertico/service_spec.rb in zertico-0.5.6
- old
+ new
@@ -3,11 +3,21 @@
describe Zertico::Service do
let(:controller) { UserController.new }
let(:admin_controller) { Admin::UserController.new }
let(:profile_controller) { Person::ProfileController.new }
let(:object) { Object.new }
+ let(:pluralized_controller) { UsersController.new }
+ context 'on a pluralized name controller' do
+ it 'should find the interface model' do
+ pluralized_controller.send(:interface_name).should == 'user'
+ end
+ it 'should find the interface class' do
+ pluralized_controller.send(:interface_class).should == User
+ end
+ end
+
context 'on a namespaced controller and interface model' do
it 'should find the interface model' do
profile_controller.send(:interface_class).should == Person::Profile
end
end
@@ -89,6 +99,6 @@
it 'should return the destroyed object' do
controller.delete(1).should == { :person => object }
end
end
-end
\ No newline at end of file
+end