Improve variable comparison

This commit is contained in:
Matija Čupić 2018-05-04 12:35:36 +02:00
parent 980fb6fb26
commit c6e394bb84
No known key found for this signature in database
GPG Key ID: 4BAF84FFACD2E5DE
2 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,8 @@ describe Gitlab::Ci::Pipeline::Chain::Build do
expect(pipeline.tag).to be false
expect(pipeline.user).to eq user
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
it 'sets a valid config source' do

View File

@ -557,9 +557,8 @@ describe Ci::CreatePipelineService do
subject { execute_service(variables_attributes: variables_attributes) }
it 'creates a pipeline with specified variables' do
expect(subject.variables.count).to eq(variables_attributes.count)
expect(subject.variables.first.key).to eq(variables_attributes.first[:key])
expect(subject.variables.last.secret_value).to eq(variables_attributes.last[:secret_value])
expect(subject.variables.map { |var| var.slice(:key, :secret_value) })
.to eq variables_attributes.map(&:with_indifferent_access)
end
end
end