summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-06-09 22:58:28 +0200
committerJan Provaznik <jprovaznik@gitlab.com>2018-06-09 22:58:28 +0200
commit7fcfe7ccab12e69d7f1d0130614c3dfa374f05d3 (patch)
treec6498fe3ee3f0e315bdfe24b234b76df8248bd65
parentf646a8b9bc95fd6cecaa754f7dd0e8370c201502 (diff)
downloadgitlab-ce-7fcfe7ccab12e69d7f1d0130614c3dfa374f05d3.tar.gz
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
-rw-r--r--spec/controllers/boards/lists_controller_spec.rb18
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