From a8887a0d9c4a41a0707b92189572aeff10566af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= Date: Mon, 29 Jan 2018 18:54:16 +0100 Subject: Use `resource` in Group Variables routing scheme --- .../groups/variables_controller_spec.rb | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'spec/controllers/groups') diff --git a/spec/controllers/groups/variables_controller_spec.rb b/spec/controllers/groups/variables_controller_spec.rb index 4299c3b0040..96f1dc4d0ce 100644 --- a/spec/controllers/groups/variables_controller_spec.rb +++ b/spec/controllers/groups/variables_controller_spec.rb @@ -9,12 +9,26 @@ describe Groups::VariablesController do group.add_master(user) end - describe 'POST #save_multiple' do + describe 'GET #show' do + let!(:variable) { create(:ci_group_variable, group: group) } + + subject do + get :show, group_id: group, 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_group_variable, group: group) } context 'with invalid new variable parameters' do subject do - post :save_multiple, + post :update, group_id: group, variables_attributes: [{ id: variable.id, key: variable.key, value: 'other_value', @@ -41,7 +55,7 @@ describe Groups::VariablesController do context 'with valid new variable parameters' do subject do - post :save_multiple, + post :update, group_id: group, variables_attributes: [{ id: variable.id, key: variable.key, value: 'other_value', @@ -68,7 +82,7 @@ describe Groups::VariablesController do context 'with a deleted variable' do subject do - post :save_multiple, + post :update, group_id: group, variables_attributes: [{ id: variable.id, key: variable.key, value: variable.value, -- cgit v1.2.1