diff options
author | charlieablett <cablett@gitlab.com> | 2019-06-07 04:56:40 +0300 |
---|---|---|
committer | charlieablett <cablett@gitlab.com> | 2019-06-10 10:55:37 +0300 |
commit | 714018145cb0ea3265dcfa64c9b4baa33dee588f (patch) | |
tree | face868d9c4bd50c22b7df869f6f0a04788cdb4a | |
parent | 27dd0b8e3609aae92b8e59dd202a999fc1db5a4e (diff) |
Add `to_json` to `represent` method call
-rw-r--r-- | app/controllers/concerns/boards_responses.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/3861-use-serializers-for-project-group-boards.yml (renamed from changelogs/unreleased/ce-3861-use-serializers-for-project-group-boards.yml) | 0 | ||||
-rw-r--r-- | spec/controllers/concerns/boards_responses_spec.rb | 4 |
3 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/concerns/boards_responses.rb b/app/controllers/concerns/boards_responses.rb index ce2740147f7..128409a2eef 100644 --- a/app/controllers/concerns/boards_responses.rb +++ b/app/controllers/concerns/boards_responses.rb @@ -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) diff --git a/changelogs/unreleased/ce-3861-use-serializers-for-project-group-boards.yml b/changelogs/unreleased/3861-use-serializers-for-project-group-boards.yml index de67944b7b7..de67944b7b7 100644 --- a/changelogs/unreleased/ce-3861-use-serializers-for-project-group-boards.yml +++ b/changelogs/unreleased/3861-use-serializers-for-project-group-boards.yml diff --git a/spec/controllers/concerns/boards_responses_spec.rb b/spec/controllers/concerns/boards_responses_spec.rb index 1c837fe8755..c080ddf896f 100644 --- a/spec/controllers/concerns/boards_responses_spec.rb +++ b/spec/controllers/concerns/boards_responses_spec.rb @@ -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 |