Commit 71401814 authored by charlieablett's avatar charlieablett

Add `to_json` to `represent` method call

parent 27dd0b8e
...@@ -69,7 +69,7 @@ module BoardsResponses ...@@ -69,7 +69,7 @@ module BoardsResponses
end end
def serialize_as_json(resource) def serialize_as_json(resource)
serializer.represent(resource) serializer.represent(resource).to_json
end end
def respond_with(resource) def respond_with(resource)
......
...@@ -15,9 +15,9 @@ describe BoardsResponses do ...@@ -15,9 +15,9 @@ describe BoardsResponses do
let!(:board) { create(:board) } let!(:board) { create(:board) }
it 'serializes properly' do 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 end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment