diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2018-06-09 23:58:28 +0300 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2018-06-09 23:58:28 +0300 |
commit | 7fcfe7ccab12e69d7f1d0130614c3dfa374f05d3 (patch) | |
tree | c6498fe3ee3f0e315bdfe24b234b76df8248bd65 /spec | |
parent | f646a8b9bc95fd6cecaa754f7dd0e8370c201502 (diff) |
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
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/boards/lists_controller_spec.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/spec/controllers/boards/lists_controller_spec.rb b/spec/controllers/boards/lists_controller_spec.rb index 71d45a22d91..57ccbf1d6b5 100644 --- a/spec/controllers/boards/lists_controller_spec.rb +++ b/spec/controllers/boards/lists_controller_spec.rb @@ -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 |