As the project has been renamed, its better to reflect it in the source code as well. JSONAPI::Serializer is evaluated from FastJsonapi::ObjectSerializer so this change probably will go unnoticed in gem usage.
26 lines
583 B
Ruby
26 lines
583 B
Ruby
require 'spec_helper'
|
|
|
|
RSpec.describe JSONAPI::Serializer do
|
|
let(:actor) { Actor.fake }
|
|
let(:params) { {} }
|
|
|
|
describe 'with errors' do
|
|
it do
|
|
expect do
|
|
BadMovieSerializerActorSerializer.new(
|
|
actor, include: ['played_movies']
|
|
)
|
|
end.to raise_error(
|
|
NameError, /cannot resolve a serializer class for 'bad'/
|
|
)
|
|
end
|
|
|
|
it do
|
|
expect { ActorSerializer.new(actor, include: ['bad_include']) }
|
|
.to raise_error(
|
|
ArgumentError, /bad_include is not specified as a relationship/
|
|
)
|
|
end
|
|
end
|
|
end
|