spec/zertico/service/instance_methods_spec.rb in zertico-2.0.0.alpha.1 vs spec/zertico/service/instance_methods_spec.rb in zertico-2.0.0.alpha.2
- old
+ new
@@ -119,100 +119,6 @@
it 'should return it!' do
expect(users_service.resource_source).to eq(Person::Profile)
end
end
end
-
- describe '#interface_id' do
- context 'on a pluralized service' do
- it 'should return id' do
- expect(users_service.send(:interface_id)).to eq('id')
- end
- end
-
- context 'on a namespaced service and interface model' do
- it 'should return id with the model name' do
- expect(profile_service.send(:interface_id)).to eq('person_profile_id')
- end
- end
-
- context 'on a namespaced service and non namespaced interface model' do
- it 'should return id with the model name' do
- expect(admin_service.send(:interface_id)).to eq('user_id')
- end
- end
-
- context 'on a non namespaced service and non namespaced interface model' do
- it 'should return id' do
- expect(users_service.send(:interface_id)).to eq('id')
- end
- end
-
- context 'on a namespaced service and an undefined interface model' do
- it 'should return id' do
- expect(gifts_service.send(:interface_id)).to eq('id')
- end
- end
-
- context 'when defined on class' do
- before :each do
- gifts_service.class.instance_variable_set('@interface_id', 'abc')
- end
-
- it 'should return the defined value' do
- expect(gifts_service.send(:interface_id)).to eq('abc')
- end
- end
- end
-
- describe '#interface_name' do
- it 'should return the interface name' do
- expect(users_service.send(:interface_name)).to eq('user')
- end
-
- context 'when defined on class' do
- before :each do
- gifts_service.class.instance_variable_set('@interface_name', 'abc')
- end
-
- it 'should return the defined value' do
- expect(gifts_service.send(:interface_name)).to eq('abc')
- end
- end
- end
-
- describe '#interface_class' do
- context 'on a pluralized service' do
- it 'should find the interface model' do
- expect(users_service.send(:interface_class)).to eq(User)
- end
- end
-
- context 'on a namespaced service and interface model' do
- it 'should find the interface model' do
- expect(profile_service.send(:interface_class)).to eq(Person::Profile)
- end
- end
-
- context 'on a namespaced service and non namespaced interface model' do
- it 'should find the interface model' do
- expect(admin_service.send(:interface_class)).to eq(User)
- end
- end
-
- context 'on a non namespaced service and non namespaced interface model' do
- it 'should find the interface model' do
- expect(users_service.send(:interface_class)).to eq(User)
- end
- end
-
- context 'when defined on class' do
- before :each do
- gifts_service.class.instance_variable_set('@interface_class', User)
- end
-
- it 'should return the defined value' do
- expect(gifts_service.send(:interface_class)).to eq(User)
- end
- end
- end
end
\ No newline at end of file