diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-24 15:09:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-24 15:09:01 +0300 |
commit | 2c2dd5e36c4ed5f09f488be288882d98f9124d12 (patch) | |
tree | ad4c478bb1c588387a881b26a7db7c3237b9d4f3 /spec/lib/gitlab/application_context_spec.rb | |
parent | 2ff184ad761fbfbe25a3d827c8f704349963a8d2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/application_context_spec.rb')
-rw-r--r-- | spec/lib/gitlab/application_context_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/application_context_spec.rb b/spec/lib/gitlab/application_context_spec.rb index 1fd400294b7..c6bc3c945a8 100644 --- a/spec/lib/gitlab/application_context_spec.rb +++ b/spec/lib/gitlab/application_context_spec.rb @@ -79,4 +79,18 @@ describe Gitlab::ApplicationContext do .to include(project: project.full_path, root_namespace: project.full_path_components.first) end end + + describe '#use' do + let(:context) { described_class.new(user: build(:user)) } + + it 'yields control' do + expect { |b| context.use(&b) }.to yield_control + end + + it 'passes the expected context on to labkit' do + expect(Labkit::Context).to receive(:with_context).with(a_hash_including(user: duck_type(:call))) + + context.use {} + end + end end |