diff options
author | Rémy Coutable <remy@rymai.me> | 2017-07-18 12:09:47 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-07-18 12:09:47 +0000 |
commit | f3e682c03fa84adea99d55ac74e32d53164cd99b (patch) | |
tree | 695c197151fe0ee2330db86328440fa6b390a49d /spec/models/commit_spec.rb | |
parent | f48264555563a906472795bc9fbccd09be4b6a47 (diff) | |
parent | f69c0f801f3db8cc534bc9652fbdb01bb15a5340 (diff) | |
download | gitlab-ce-f3e682c03fa84adea99d55ac74e32d53164cd99b.tar.gz |
Merge branch 'request-store-wrap' into 'master'
Add RequestCache to cache via RequestStore
See merge request !12920
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r-- | spec/models/commit_spec.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 6056d78da4e..528b211c9d6 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -19,17 +19,15 @@ describe Commit, models: true do expect(commit.author).to eq(user) end - it 'caches the author' do - allow(RequestStore).to receive(:active?).and_return(true) + it 'caches the author', :request_store do user = create(:user, email: commit.author_email) - expect_any_instance_of(Commit).to receive(:find_author_by_any_email).and_call_original + expect(User).to receive(:find_by_any_email).and_call_original expect(commit.author).to eq(user) - key = "commit_author:#{commit.author_email}" + key = "Commit:author:#{commit.author_email.downcase}" expect(RequestStore.store[key]).to eq(user) expect(commit.author).to eq(user) - RequestStore.store.clear end end |