Add specs for method that exposes build variables hash
This commit is contained in:
parent
3ab013634d
commit
a60ccef9fe
2 changed files with 12 additions and 3 deletions
|
@ -288,9 +288,6 @@ module Ci
|
||||||
.to_runner_variables
|
.to_runner_variables
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# TODO, add specs
|
|
||||||
#
|
|
||||||
def variables_hash
|
def variables_hash
|
||||||
scoped_variables.to_hash
|
scoped_variables.to_hash
|
||||||
end
|
end
|
||||||
|
|
|
@ -2053,6 +2053,18 @@ describe Ci::Build do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#variables_hash' do
|
||||||
|
before do
|
||||||
|
project.variables.create!(key: 'MY_VAR', value: 'my value 1')
|
||||||
|
pipeline.variables.create!(key: 'MY_VAR', value: 'my value 2')
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'returns a regular hash created in valid order' do
|
||||||
|
expect(build.variables_hash).to include('MY_VAR': 'my value 2')
|
||||||
|
expect(build.variables_hash).not_to include('MY_VAR': 'my value 1')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe 'state transition: any => [:pending]' do
|
describe 'state transition: any => [:pending]' do
|
||||||
let(:build) { create(:ci_build, :created) }
|
let(:build) { create(:ci_build, :created) }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue