jsonapi-serializer/spec/shared/examples/object_serializer_class_methods_examples.rb
Shuhei Kitagawa cdfac8743d Refactor object serializer class methods spec (#134)
* Add object_serializer_class_methods_examples

* Change to require spec/shared/examples in every spec files

* Refactor object_serializer_class_methods_spec
2018-03-26 22:16:37 -07:00

10 lines
444 B
Ruby

RSpec.shared_examples 'returning correct relationship hash' do |serializer, id_method_name, record_type|
it 'returns correct relationship hash' do
expect(relationship).to be_instance_of(Hash)
expect(relationship.keys).to all(be_instance_of(Symbol))
expect(relationship[:serializer]).to be serializer
expect(relationship[:id_method_name]).to be id_method_name
expect(relationship[:record_type]).to be record_type
end
end