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