2017-05-03 18:51:55 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Groups::VariablesController do
|
|
|
|
let(:group) { create(:group) }
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
group.add_master(user)
|
|
|
|
end
|
|
|
|
|
2018-01-29 17:54:16 +00:00
|
|
|
describe 'GET #show' do
|
|
|
|
let!(:variable) { create(:ci_group_variable, group: group) }
|
|
|
|
|
|
|
|
subject do
|
|
|
|
get :show, group_id: group, format: :json
|
|
|
|
end
|
|
|
|
|
2018-02-02 18:35:00 +00:00
|
|
|
include_examples 'GET #show lists all variables'
|
2018-01-29 17:54:16 +00:00
|
|
|
end
|
|
|
|
|
2018-02-02 18:35:00 +00:00
|
|
|
describe 'PATCH #update' do
|
2018-01-23 18:24:55 +00:00
|
|
|
let!(:variable) { create(:ci_group_variable, group: group) }
|
2018-02-02 18:35:00 +00:00
|
|
|
let(:owner) { group }
|
2018-02-02 17:54:13 +00:00
|
|
|
|
|
|
|
subject do
|
|
|
|
patch :update,
|
|
|
|
group_id: group,
|
|
|
|
variables_attributes: variables_attributes,
|
|
|
|
format: :json
|
|
|
|
end
|
|
|
|
|
2018-02-02 18:35:00 +00:00
|
|
|
include_examples 'PATCH #update updates variables'
|
2018-01-23 18:24:55 +00:00
|
|
|
end
|
2017-05-03 18:51:55 +00:00
|
|
|
end
|