Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'qa/spec/resource/base_spec.rb')
-rw-r--r--qa/spec/resource/base_spec.rb22
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