diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /qa/spec/resource/base_spec.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'qa/spec/resource/base_spec.rb')
-rw-r--r-- | qa/spec/resource/base_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/qa/spec/resource/base_spec.rb b/qa/spec/resource/base_spec.rb index f23f4aa728b..195e497f290 100644 --- a/qa/spec/resource/base_spec.rb +++ b/qa/spec/resource/base_spec.rb @@ -24,6 +24,10 @@ RSpec.describe QA::Resource::Base do 'block' end + attribute :token do + 'token_value' + end + attribute :username do 'qa' end @@ -208,6 +212,24 @@ RSpec.describe QA::Resource::Base do .to have_received(:debug).with(/api_with_block/) end end + + context 'when the attribute is token and has a block' do + let(:api_resource) { { token: 'another_token_value' } } + + before do + allow(QA::Runtime::Logger).to receive(:debug) + end + + it 'emits a masked debug log entry' do + result = subject.fabricate!(resource: resource) + + expect(result).to be_a(described_class) + expect(result.token).to eq('another_token_value') + + expect(QA::Runtime::Logger) + .to have_received(:debug).with(/MASKED/) + end + end end context 'when the attribute is populated via direct assignment' do |