Add to_json
to represent
method call
This commit is contained in:
parent
27dd0b8e36
commit
714018145c
3 changed files with 3 additions and 3 deletions
|
@ -69,7 +69,7 @@ module BoardsResponses
|
|||
end
|
||||
|
||||
def serialize_as_json(resource)
|
||||
serializer.represent(resource)
|
||||
serializer.represent(resource).to_json
|
||||
end
|
||||
|
||||
def respond_with(resource)
|
||||
|
|
|
@ -15,9 +15,9 @@ describe BoardsResponses do
|
|||
let!(:board) { create(:board) }
|
||||
|
||||
it 'serializes properly' do
|
||||
expected = { id: board.id }
|
||||
expected = { "id" => board.id }
|
||||
|
||||
expect(subject.serialize_as_json(board).to_h).to include(expected)
|
||||
expect(JSON.parse(subject.serialize_as_json(board))).to include(expected)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue