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 similarity index 100% rename from changelogs/unreleased/ce-3861-use-serializers-for-project-group-boards.yml rename to 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