diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-06-01 10:31:33 +0200 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-06-01 10:31:33 +0200 |
commit | 00b00f1edee71d236b0cd5b796bb68f15142911f (patch) | |
tree | 471ef31c0c455abe44f04dcd7d2ba84e87f22be1 /spec/lib/banzai/reference_parser/user_parser_spec.rb | |
parent | f4aa01053ed39a265ddfd9ee6e9618bd3406e59d (diff) | |
parent | dd0f8b8ccc3b5f61e31703f7391a919b702934a5 (diff) | |
download | gitlab-ce-00b00f1edee71d236b0cd5b796bb68f15142911f.tar.gz |
Merge branch 'master' into zj-realtime-env-list
Diffstat (limited to 'spec/lib/banzai/reference_parser/user_parser_spec.rb')
-rw-r--r-- | spec/lib/banzai/reference_parser/user_parser_spec.rb | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/spec/lib/banzai/reference_parser/user_parser_spec.rb b/spec/lib/banzai/reference_parser/user_parser_spec.rb index 4ec998efe53..592ed0d2b98 100644 --- a/spec/lib/banzai/reference_parser/user_parser_spec.rb +++ b/spec/lib/banzai/reference_parser/user_parser_spec.rb @@ -42,6 +42,29 @@ describe Banzai::ReferenceParser::UserParser, lib: true do expect(subject.referenced_by([link])).to eq([user]) end + + context 'when RequestStore is active' do + let(:other_user) { create(:user) } + + before do + RequestStore.begin! + end + + after do + RequestStore.end! + RequestStore.clear! + end + + it 'does not return users from the first call in the second' do + link['data-user'] = user.id.to_s + + expect(subject.referenced_by([link])).to eq([user]) + + link['data-user'] = other_user.id.to_s + + expect(subject.referenced_by([link])).to eq([other_user]) + end + end end context 'when the link has a data-project attribute' do @@ -74,7 +97,7 @@ describe Banzai::ReferenceParser::UserParser, lib: true do end end - describe '#nodes_visible_to_use?' do + describe '#nodes_visible_to_user' do context 'when the link has a data-group attribute' do context 'using an existing group ID' do before do |