diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-08 09:08:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-08 09:08:32 +0300 |
commit | f9e55cc3c9ec3258051c60562b011bef22075f2a (patch) | |
tree | 67742b507188dcc8e9892f78477bb56bb4f1fa3b /spec/tasks | |
parent | 0c8e6bebbb74c8b3f9acf1b685851621e386296c (diff) |
Add latest changes from gitlab-org/gitlab@master
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 |