Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/jsonapi/render_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class VisualArtistDecorator < Roar::Decorator
link(:wikipedia_page) { "https://en.wikipedia.org/wiki/#{represented.name}" }
end

Painter = Struct.new(:id, :name, :known_aliases, :movement, :noteable_works)
let(:painter_class) { Struct.new(:id, :name, :known_aliases, :movement, :noteable_works) }

let(:document) {
%({
Expand Down Expand Up @@ -303,7 +303,7 @@ class VisualArtistDecorator < Roar::Decorator
}

let(:painter) {
Painter.new('p1', 'Pablo Picasso', ['Pablo Ruiz Picasso'], 'Cubism',
painter_class.new('p1', 'Pablo Picasso', ['Pablo Ruiz Picasso'], 'Cubism',
%w(Kahnweiler Guernica))
}

Expand All @@ -327,7 +327,7 @@ class ArtistDecorator < Roar::Decorator
link(:self) { "http://artists/#{represented.id}" }
end

Painter = Struct.new(:id, :name, :known_aliases, :movement, :noteable_works, :genre)
let(:painter_class) { Struct.new(:id, :name, :known_aliases, :movement, :noteable_works, :genre) }

let(:document) {
%({
Expand Down Expand Up @@ -368,7 +368,7 @@ class ArtistDecorator < Roar::Decorator
}

let(:painter) {
Painter.new('p1', nil, [], nil, [], nil)
painter_class.new('p1', nil, [], nil, [], nil)
}

it { ArtistDecorator.new(painter).to_json.must_equal_json document }
Expand Down