Commit c9f28cad authored by Matija Čupić's avatar Matija Čupić Committed by Jose

Improve variable comparison

parent e96cb240
...@@ -44,7 +44,8 @@ describe Gitlab::Ci::Pipeline::Chain::Build do ...@@ -44,7 +44,8 @@ describe Gitlab::Ci::Pipeline::Chain::Build do
expect(pipeline.tag).to be false expect(pipeline.tag).to be false
expect(pipeline.user).to eq user expect(pipeline.user).to eq user
expect(pipeline.project).to eq project expect(pipeline.project).to eq project
expect(pipeline.variables.size).to eq variables_attributes.count expect(pipeline.variables.map { |var| var.slice(:key, :secret_value) })
.to eq variables_attributes.map(&:with_indifferent_access)
end end
it 'sets a valid config source' do it 'sets a valid config source' do
......
...@@ -557,9 +557,8 @@ describe Ci::CreatePipelineService do ...@@ -557,9 +557,8 @@ describe Ci::CreatePipelineService do
subject { execute_service(variables_attributes: variables_attributes) } subject { execute_service(variables_attributes: variables_attributes) }
it 'creates a pipeline with specified variables' do it 'creates a pipeline with specified variables' do
expect(subject.variables.count).to eq(variables_attributes.count) expect(subject.variables.map { |var| var.slice(:key, :secret_value) })
expect(subject.variables.first.key).to eq(variables_attributes.first[:key]) .to eq variables_attributes.map(&:with_indifferent_access)
expect(subject.variables.last.secret_value).to eq(variables_attributes.last[:secret_value])
end end
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