debian-mirror-gitlab/spec/controllers/groups/variables_controller_spec.rb

36 lines
747 B
Ruby
Raw Normal View History

2017-09-10 17:25:29 +05:30
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-03-17 18:26:18 +05:30
describe 'GET #show' do
let!(:variable) { create(:ci_group_variable, group: group) }
2017-09-10 17:25:29 +05:30
2018-03-17 18:26:18 +05:30
subject do
get :show, group_id: group, format: :json
2017-09-10 17:25:29 +05:30
end
2018-03-17 18:26:18 +05:30
include_examples 'GET #show lists all variables'
end
2017-09-10 17:25:29 +05:30
2018-03-17 18:26:18 +05:30
describe 'PATCH #update' do
let!(:variable) { create(:ci_group_variable, group: group) }
let(:owner) { group }
2017-09-10 17:25:29 +05:30
2018-03-17 18:26:18 +05:30
subject do
patch :update,
group_id: group,
variables_attributes: variables_attributes,
format: :json
2017-09-10 17:25:29 +05:30
end
2018-03-17 18:26:18 +05:30
include_examples 'PATCH #update updates variables'
2017-09-10 17:25:29 +05:30
end
end