Commit 1d90e4d3 authored by Matija Čupić's avatar Matija Čupić

Fix failing variable specs

parent 8bffd85b
...@@ -75,8 +75,8 @@ describe Ci::Build do ...@@ -75,8 +75,8 @@ describe Ci::Build do
subject { job.variables } subject { job.variables }
context 'when environment specific variable is defined' do context 'when environment specific variable is defined' do
let(:environment_varialbe) do let(:environment_variable) do
{ key: 'ENV_KEY', value: 'environment', public: false } { key: 'ENV_KEY', value: 'environment', public: false, masked: false }
end end
before do before do
...@@ -85,7 +85,7 @@ describe Ci::Build do ...@@ -85,7 +85,7 @@ describe Ci::Build do
variable = variable =
build(:ci_variable, build(:ci_variable,
environment_varialbe.slice(:key, :value) environment_variable.slice(:key, :value)
.merge(project: project, environment_scope: 'stag*')) .merge(project: project, environment_scope: 'stag*'))
variable.save! variable.save!
...@@ -96,7 +96,7 @@ describe Ci::Build do ...@@ -96,7 +96,7 @@ describe Ci::Build do
stub_licensed_features(variable_environment_scope: true) stub_licensed_features(variable_environment_scope: true)
end end
it { is_expected.to include(environment_varialbe) } it { is_expected.to include(environment_variable) }
end end
context 'when variable environment scope is not available' do context 'when variable environment scope is not available' do
...@@ -104,12 +104,12 @@ describe Ci::Build do ...@@ -104,12 +104,12 @@ describe Ci::Build do
stub_licensed_features(variable_environment_scope: false) stub_licensed_features(variable_environment_scope: false)
end end
it { is_expected.not_to include(environment_varialbe) } it { is_expected.not_to include(environment_variable) }
end end
context 'when there is a plan for the group' do context 'when there is a plan for the group' do
it 'GITLAB_FEATURES should include the features for that plan' do it 'GITLAB_FEATURES should include the features for that plan' do
is_expected.to include({ key: 'GITLAB_FEATURES', value: anything, public: true }) is_expected.to include({ key: 'GITLAB_FEATURES', value: anything, public: true, masked: false })
features_variable = subject.find { |v| v[:key] == 'GITLAB_FEATURES' } features_variable = subject.find { |v| v[:key] == 'GITLAB_FEATURES' }
expect(features_variable[:value]).to include('multiple_ldap_servers') expect(features_variable[:value]).to include('multiple_ldap_servers')
end end
......
...@@ -46,7 +46,7 @@ describe API::Runner, :clean_gitlab_redis_shared_state do ...@@ -46,7 +46,7 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
expect(response).to have_http_status(:created) expect(response).to have_http_status(:created)
expect(json_response).to include( expect(json_response).to include(
"id" => build.id, "id" => build.id,
"variables" => include("key" => 'KEY', "value" => 'value', "public" => true), "variables" => include("key" => 'KEY', "value" => 'value', "public" => true, "masked" => false),
"image" => a_hash_including("name" => 'ruby'), "image" => a_hash_including("name" => 'ruby'),
"services" => all(a_hash_including("name" => 'mysql')), "services" => all(a_hash_including("name" => 'mysql')),
"job_info" => a_hash_including("name" => 'terminal', "stage" => 'terminal')) "job_info" => a_hash_including("name" => 'terminal', "stage" => 'terminal'))
......
...@@ -38,7 +38,7 @@ describe Ci::ProcessPipelineService, '#execute' do ...@@ -38,7 +38,7 @@ describe Ci::ProcessPipelineService, '#execute' do
expect(downstream.ci_pipelines.first).to be_pending expect(downstream.ci_pipelines.first).to be_pending
expect(downstream.builds).not_to be_empty expect(downstream.builds).not_to be_empty
expect(downstream.builds.first.variables) expect(downstream.builds.first.variables)
.to include(key: 'BRIDGE', value: 'cross', public: false) .to include(key: 'BRIDGE', value: 'cross', public: false, masked: false)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment