diff options
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/gitlab/db/validate_config_rake_spec.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/tasks/gitlab/db/validate_config_rake_spec.rb b/spec/tasks/gitlab/db/validate_config_rake_spec.rb index 7b2f37414a0..2201db51275 100644 --- a/spec/tasks/gitlab/db/validate_config_rake_spec.rb +++ b/spec/tasks/gitlab/db/validate_config_rake_spec.rb @@ -72,18 +72,23 @@ RSpec.describe 'gitlab:db:validate_config', :silence_stdout do expect { run_rake_task('gitlab:db:validate_config') }.to raise_error(match) end - it 'to stderr instead of exception for production' do + it 'for production' do allow(Gitlab).to receive(:dev_or_test_env?).and_return(false) - expect { run_rake_task('gitlab:db:validate_config') }.to output(match).to_stderr + expect { run_rake_task('gitlab:db:validate_config') }.to raise_error(match) end - it 'if GITLAB_VALIDATE_DATABASE_CONFIG is set' do + it 'if GITLAB_VALIDATE_DATABASE_CONFIG=1' do stub_env('GITLAB_VALIDATE_DATABASE_CONFIG', '1') - allow(Gitlab).to receive(:dev_or_test_env?).and_return(false) expect { run_rake_task('gitlab:db:validate_config') }.to raise_error(match) end + + it 'to stderr if GITLAB_VALIDATE_DATABASE_CONFIG=0' do + stub_env('GITLAB_VALIDATE_DATABASE_CONFIG', '0') + + expect { run_rake_task('gitlab:db:validate_config') }.to output(match).to_stderr + end end context 'when only main: is specified' do |