diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-01-29 18:54:16 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-02-05 18:58:19 +0100 |
commit | a8887a0d9c4a41a0707b92189572aeff10566af6 (patch) | |
tree | 6c7fb9025c2f1ffc7ae82ecaeffd0facd21c042d /spec/controllers/groups/variables_controller_spec.rb | |
parent | 0bfcdd66bf932c080398ff264323b5c0df17d05c (diff) | |
download | gitlab-ce-a8887a0d9c4a41a0707b92189572aeff10566af6.tar.gz |
Use `resource` in Group Variables routing scheme
Diffstat (limited to 'spec/controllers/groups/variables_controller_spec.rb')
-rw-r--r-- | spec/controllers/groups/variables_controller_spec.rb | 22 |
1 files changed, 18 insertions, 4 deletions
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, |