Commit 2b1153f7 authored by blackst0ne's avatar blackst0ne

[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
parent a76066d7
---
title: "[Rails5] Fix pipeline_schedules_controller_spec"
merge_request: 19919
author: "@blackst0ne"
type: fixed
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment