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-29 20:39:06 +0300
committerMatija Čupić <matteeyah@gmail.com>2018-02-05 20:58:18 +0300
commit0bfcdd66bf932c080398ff264323b5c0df17d05c (patch)
tree1c306a83624c53ec65ec67229de5033096d35593 /spec/controllers/projects
parent6b82a9ef51f59d37975bd5de48142d1a0a8504de (diff)
Use `resource` in Project Variables routing scheme
Diffstat (limited to 'spec/controllers/projects')
-rw-r--r--spec/controllers/projects/variables_controller_spec.rb27
1 files changed, 23 insertions, 4 deletions
diff --git a/spec/controllers/projects/variables_controller_spec.rb b/spec/controllers/projects/variables_controller_spec.rb
index ac5c453a8ab..f6e15ee6147 100644
--- a/spec/controllers/projects/variables_controller_spec.rb
+++ b/spec/controllers/projects/variables_controller_spec.rb
@@ -9,7 +9,26 @@ describe Projects::VariablesController do
project.add_master(user)
end
- describe 'POST #save_multiple' do
+ describe 'GET #show' do
+ let(:variable) { create(:ci_variable) }
+
+ before do
+ project.variables << variable
+ end
+
+ subject do
+ get :show, namespace_id: project.namespace.to_param, project_id: project,
+ format: :json
+ end
+
+ it 'renders the ci_variable as json' do
+ subject
+
+ expect(response.body).to include(variable.to_json)
+ end
+ end
+
+ describe 'POST #update' do
let(:variable) { create(:ci_variable) }
before do
@@ -18,7 +37,7 @@ describe Projects::VariablesController do
context 'with invalid new variable parameters' do
subject do
- post :save_multiple,
+ post :update,
namespace_id: project.namespace.to_param, project_id: project,
variables_attributes: [{ id: variable.id, key: variable.key,
value: 'other_value',
@@ -45,7 +64,7 @@ describe Projects::VariablesController do
context 'with valid new variable parameters' do
subject do
- post :save_multiple,
+ post :update,
namespace_id: project.namespace.to_param, project_id: project,
variables_attributes: [{ id: variable.id, key: variable.key,
value: 'other_value',
@@ -72,7 +91,7 @@ describe Projects::VariablesController do
context 'with a deleted variable' do
subject do
- post :save_multiple,
+ post :update,
namespace_id: project.namespace.to_param, project_id: project,
variables_attributes: [{ id: variable.id, key: variable.key,
value: variable.value,