Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent parallel test failures in request_spec #3505

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion spec/unit/lib/vcap/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,22 @@ module VCAP
end

let(:user_guid) { SecureRandom.uuid }
let(:data) { {} }

before do
allow(Steno.config.context).to receive(:data).and_return(data)
end

it 'sets the new user_guid on the Steno logger context' do
Request.user_guid = user_guid

expect(Steno.config.context.data['user_guid']).to eq user_guid
expect(Steno.config.context.data.fetch('user_guid')).to eq user_guid
end

it 'deletes from the Steno logger context when set to nil' do
Request.user_guid = nil

expect(Steno.config.context.data.key?('user_guid')).to be false
end
end
end
Expand Down