summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-01-12 22:39:42 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-02-05 18:57:42 +0100
commitfe96a1f268558526fd122a348866fbf513ac17e2 (patch)
tree83383472b6bd763570157856131c47013a0e0787
parent2150ed4094ddb67d7b403cd56360700c80e7d928 (diff)
downloadgitlab-ce-fe96a1f268558526fd122a348866fbf513ac17e2.tar.gz
Stub multiple variable controller method
-rw-r--r--app/controllers/projects/variables_controller.rb4
-rw-r--r--config/routes/project.rb7
-rw-r--r--spec/controllers/projects/variables_controller_spec.rb7
3 files changed, 17 insertions, 1 deletions
diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb
index 6a825137564..b7b88830837 100644
--- a/app/controllers/projects/variables_controller.rb
+++ b/app/controllers/projects/variables_controller.rb
@@ -32,6 +32,10 @@ class Projects::VariablesController < Projects::ApplicationController
end
end
+ def save_multiple
+ head :ok
+ end
+
def destroy
if variable.destroy
redirect_to project_settings_ci_cd_path(project),
diff --git a/config/routes/project.rb b/config/routes/project.rb
index bcaa68c8ce5..8b65240ade4 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -156,7 +156,12 @@ constraints(ProjectUrlConstrainer.new) do
end
end
- resources :variables, only: [:index, :show, :update, :create, :destroy]
+ resources :variables, only: [:index, :show, :update, :create, :destroy] do
+ collection do
+ post :save_multiple
+ end
+ end
+
resources :triggers, only: [:index, :create, :edit, :update, :destroy] do
member do
post :take_ownership
diff --git a/spec/controllers/projects/variables_controller_spec.rb b/spec/controllers/projects/variables_controller_spec.rb
index 9fde6544215..97284909b3c 100644
--- a/spec/controllers/projects/variables_controller_spec.rb
+++ b/spec/controllers/projects/variables_controller_spec.rb
@@ -55,4 +55,11 @@ describe Projects::VariablesController do
end
end
end
+
+ describe 'POST #save_multiple' do
+ it 'returns a successful response' do
+ post :save_multiple, namespace_id: project.namespace.to_param, project_id: project
+ expect(response).to have_gitlab_http_status(:ok)
+ end
+ end
end