Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-01-23 03:17:40 +0300
committerMatija Čupić <matteeyah@gmail.com>2018-02-05 20:57:43 +0300
commit5de85708ce17c1965581b8bf7563751dda77510d (patch)
treee8873b614aae25144e48eacf468ed35305d5fe29 /spec/controllers/projects
parentba077841922089c0eb2bbb48947de8828f891776 (diff)
Use nested attributes for updating multiple variables
Diffstat (limited to 'spec/controllers/projects')
-rw-r--r--spec/controllers/projects/variables_controller_spec.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/controllers/projects/variables_controller_spec.rb b/spec/controllers/projects/variables_controller_spec.rb
index 87463f00b8f..946110c0e64 100644
--- a/spec/controllers/projects/variables_controller_spec.rb
+++ b/spec/controllers/projects/variables_controller_spec.rb
@@ -67,8 +67,8 @@ describe Projects::VariablesController do
subject do
post :save_multiple,
namespace_id: project.namespace.to_param, project_id: project,
- variables: [{ key: variable.key, value: 'other_value' },
- { key: '..?', value: 'dummy_value' }],
+ variables_attributes: [{ id: variable.id, key: variable.key, value: 'other_value' },
+ { key: '..?', value: 'dummy_value' }],
format: :json
end
@@ -91,8 +91,8 @@ describe Projects::VariablesController do
subject do
post :save_multiple,
namespace_id: project.namespace.to_param, project_id: project,
- variables: [{ key: variable.key, value: 'other_value' },
- { key: 'new_key', value: 'dummy_value' }],
+ variables_attributes: [{ id: variable.id, key: variable.key, value: 'other_value' },
+ { key: 'new_key', value: 'dummy_value' }],
format: :json
end
@@ -115,7 +115,8 @@ describe Projects::VariablesController do
subject do
post :save_multiple,
namespace_id: project.namespace.to_param, project_id: project,
- variables: [{ key: variable.key, value: variable.value, _destroy: 'true' }],
+ variables_attributes: [{ id: variable.id, key: variable.key,
+ value: variable.value, _destroy: 'true' }],
format: :json
end