diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-09-25 11:24:28 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-09-25 11:24:28 +0000 |
commit | a1ee365843dccc265557904051e8bd51d5f54488 (patch) | |
tree | 38741180b8b10000d8e40a0056653ac45db5a90c /spec/lib/gitlab/git/hook_env_spec.rb | |
parent | cdff2c664131bc1b20685ee2fc0372c11ee028f8 (diff) | |
parent | 74ae135888f55c17f6c53bcba9c1ca979a33724e (diff) | |
download | gitlab-ce-a1ee365843dccc265557904051e8bd51d5f54488.tar.gz |
Merge branch 'mk/improve-usage-of-request-store' into 'master'
Resolve "Provide NullStore for RequestStore"
Closes #51718
See merge request gitlab-org/gitlab-ce!21848
Diffstat (limited to 'spec/lib/gitlab/git/hook_env_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git/hook_env_spec.rb | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/spec/lib/gitlab/git/hook_env_spec.rb b/spec/lib/gitlab/git/hook_env_spec.rb index e6aa5ad8c90..5e49ea6da7a 100644 --- a/spec/lib/gitlab/git/hook_env_spec.rb +++ b/spec/lib/gitlab/git/hook_env_spec.rb @@ -4,11 +4,7 @@ describe Gitlab::Git::HookEnv do let(:gl_repository) { 'project-123' } describe ".set" do - context 'with RequestStore.store disabled' do - before do - allow(RequestStore).to receive(:active?).and_return(false) - end - + context 'with RequestStore disabled' do it 'does not store anything' do described_class.set(gl_repository, GIT_OBJECT_DIRECTORY_RELATIVE: 'foo') @@ -16,11 +12,7 @@ describe Gitlab::Git::HookEnv do end end - context 'with RequestStore.store enabled' do - before do - allow(RequestStore).to receive(:active?).and_return(true) - end - + context 'with RequestStore enabled', :request_store do it 'whitelist some `GIT_*` variables and stores them using RequestStore' do described_class.set( gl_repository, @@ -41,9 +33,8 @@ describe Gitlab::Git::HookEnv do end describe ".all" do - context 'with RequestStore.store enabled' do + context 'with RequestStore enabled', :request_store do before do - allow(RequestStore).to receive(:active?).and_return(true) described_class.set( gl_repository, GIT_OBJECT_DIRECTORY_RELATIVE: 'foo', @@ -60,7 +51,7 @@ describe Gitlab::Git::HookEnv do end describe ".to_env_hash" do - context 'with RequestStore.store enabled' do + context 'with RequestStore enabled', :request_store do using RSpec::Parameterized::TableSyntax let(:key) { 'GIT_OBJECT_DIRECTORY_RELATIVE' } @@ -76,7 +67,6 @@ describe Gitlab::Git::HookEnv do with_them do before do - allow(RequestStore).to receive(:active?).and_return(true) described_class.set(gl_repository, key.to_sym => input) end @@ -92,7 +82,7 @@ describe Gitlab::Git::HookEnv do end describe 'thread-safety' do - context 'with RequestStore.store enabled' do + context 'with RequestStore enabled', :request_store do before do allow(RequestStore).to receive(:active?).and_return(true) described_class.set(gl_repository, GIT_OBJECT_DIRECTORY_RELATIVE: 'foo') |