From bdb06fa0437ebc1b03377d95763d1fefdcfd0441 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Fri, 15 Apr 2016 20:43:23 +0200 Subject: [PATCH] Improve build specs for job environment variables --- spec/models/build_spec.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb index 26a063de1e..5ee40c2253 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',