summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2018-06-16 15:26:15 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2018-06-16 15:26:15 +1100
commit2b1153f71a680b0c5a4fb787897c20068a405fbf (patch)
treeee6ce0d31e62bf311dfdba364a8f044f8b86b7fa /spec/controllers
parenta76066d7fad192d8c339101d9b7dd0048fe6e303 (diff)
downloadgitlab-ce-2b1153f71a680b0c5a4fb787897c20068a405fbf.tar.gz
[Rails5] Fix pipeline_schedules_controller_specblackst0ne-rails5-fix-pipeline-schedules-controller-spec
In Rails 5.0 there's a bug [1] in controller tests that doesn't parse nested parameters correctly. This commit brings a workaround to make specs work again both in rails4 and rails5. [1]: https://github.com/rails/rails/issues/23997
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/projects/pipeline_schedules_controller_spec.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/spec/controllers/projects/pipeline_schedules_controller_spec.rb b/spec/controllers/projects/pipeline_schedules_controller_spec.rb
index 3506305f755..4cdaa54e0bc 100644
--- a/spec/controllers/projects/pipeline_schedules_controller_spec.rb
+++ b/spec/controllers/projects/pipeline_schedules_controller_spec.rb
@@ -310,9 +310,19 @@ describe Projects::PipelineSchedulesController do
end
def go
- put :update, namespace_id: project.namespace.to_param,
- project_id: project, id: pipeline_schedule,
- schedule: schedule
+ if Gitlab.rails5?
+ put :update, params: { namespace_id: project.namespace.to_param,
+ project_id: project,
+ id: pipeline_schedule,
+ schedule: schedule },
+ as: :html
+
+ else
+ put :update, namespace_id: project.namespace.to_param,
+ project_id: project,
+ id: pipeline_schedule,
+ schedule: schedule
+ end
end
end