Fix conversion of integer into string in board spec

In rails 5 controller specs, integers are converted to strings unless
conte-type is set with `as: :json`:
https://github.com/rails/rails/issues/26069
This commit is contained in:
Jan Provaznik 2018-06-09 22:58:28 +02:00
parent f646a8b9bc
commit 7fcfe7ccab

View file

@ -156,12 +156,18 @@ describe Boards::ListsController do
def move(user:, board:, list:, position:)
sign_in(user)
patch :update, namespace_id: project.namespace.to_param,
project_id: project,
board_id: board.to_param,
id: list.to_param,
list: { position: position },
format: :json
params = { namespace_id: project.namespace.to_param,
project_id: project,
board_id: board.to_param,
id: list.to_param,
list: { position: position },
format: :json }
if Gitlab.rails5?
patch :update, params: params, as: :json
else
patch :update, params
end
end
end