summaryrefslogtreecommitdiff
path: root/spec/models/build_spec.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-15 20:43:23 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-18 13:17:48 +0200
commitbdb06fa0437ebc1b03377d95763d1fefdcfd0441 (patch)
treeda69fc1e44a5b2dc0343cc541089687f903e0b13 /spec/models/build_spec.rb
parent1f3248644ef98879a8a4c31d5be0de9a774cc32a (diff)
downloadgitlab-ce-bdb06fa0437ebc1b03377d95763d1fefdcfd0441.tar.gz
Improve build specs for job environment variables
Diffstat (limited to 'spec/models/build_spec.rb')
-rw-r--r--spec/models/build_spec.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb
index 26a063de1e1..5ee40c22536 100644
--- a/spec/models/build_spec.rb
+++ b/spec/models/build_spec.rb
@@ -240,8 +240,11 @@ describe Ci::Build, models: true do
end
context 'when job variables are defined' do
+ ##
+ # Job-level variables are defined in gitlab_ci.yml fixture
+ #
context 'when job variables are unique' do
- before { allow(build).to receive(:name) { 'staging' } }
+ let(:build) { create(:ci_build, name: 'staging') }
it 'includes job variables' do
expect(subject).to include(
@@ -252,7 +255,7 @@ describe Ci::Build, models: true do
end
context 'when job variable has same key other variable has' do
- before { allow(build).to receive(:name) { 'production' } }
+ let(:build) { create(:ci_build, name: 'production') }
it 'contains job yaml variable' do
expect(subject).to include(key: :DB_NAME, value: 'mysql',