Commit 0c29aa0d authored by charlieablett's avatar charlieablett

Add `to_json` to `represent` method call

parent 71401814
...@@ -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).to_json serializer.represent(resource).as_json
end end
def respond_with(resource) def respond_with(resource)
......
---
title: Refactor Board JSON serialization to use Grape::Entity instead of manual serialization
(to_json)
merge_request:
author:
type: changed
...@@ -17,7 +17,7 @@ describe BoardsResponses do ...@@ -17,7 +17,7 @@ describe BoardsResponses do
it 'serializes properly' do it 'serializes properly' do
expected = { "id" => board.id } expected = { "id" => board.id }
expect(JSON.parse(subject.serialize_as_json(board))).to include(expected) expect(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