2017-02-02 17:25:12 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Projects::VariablesController do
|
2017-08-02 19:55:11 +00:00
|
|
|
let(:project) { create(:project) }
|
2017-02-02 17:25:12 +00:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
2018-07-11 14:36:08 +00:00
|
|
|
project.add_maintainer(user)
|
2017-02-02 17:25:12 +00:00
|
|
|
end
|
|
|
|
|
2018-01-29 17:39:06 +00:00
|
|
|
describe 'GET #show' do
|
2018-02-02 18:35:00 +00:00
|
|
|
let!(:variable) { create(:ci_variable, project: project) }
|
2018-01-29 17:39:06 +00:00
|
|
|
|
|
|
|
subject do
|
2018-02-02 17:54:13 +00:00
|
|
|
get :show, namespace_id: project.namespace.to_param, project_id: project, format: :json
|
2018-01-29 17:39:06 +00:00
|
|
|
end
|
|
|
|
|
2018-02-02 18:35:00 +00:00
|
|
|
include_examples 'GET #show lists all variables'
|
2018-01-29 17:39:06 +00:00
|
|
|
end
|
|
|
|
|
2018-02-02 18:35:00 +00:00
|
|
|
describe 'PATCH #update' do
|
|
|
|
let!(:variable) { create(:ci_variable, project: project) }
|
|
|
|
let(:owner) { project }
|
2018-02-02 17:54:13 +00:00
|
|
|
|
|
|
|
subject do
|
|
|
|
patch :update,
|
2018-02-02 18:35:00 +00:00
|
|
|
namespace_id: project.namespace.to_param,
|
|
|
|
project_id: project,
|
2018-02-02 17:54:13 +00:00
|
|
|
variables_attributes: variables_attributes,
|
|
|
|
format: :json
|
|
|
|
end
|
|
|
|
|
2018-02-02 18:35:00 +00:00
|
|
|
include_examples 'PATCH #update updates variables'
|
2018-01-12 21:39:42 +00:00
|
|
|
end
|
2017-02-02 17:25:12 +00:00
|
|
|
end
|