Commit a783a27c authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Improve specs for hiding runners tokens in traces

parent fb87512904fb
......@@ -769,33 +769,15 @@
let(:subject) { build.hide_secrets(data) }
context 'hide runners token' do
let(:data) { 'new token data'}
let(:data) { "new #{project.runners_token} data"}
before do
build.project.update(runners_token: 'token')
end
it { is_expected.to eq('new xxxxx data') }
it { is_expected.to match(/^new [x]+ data$/) }
end
context 'hide build token' do
let(:data) { 'new token data'}
before do
build.update(token: 'token')
end
it { is_expected.to eq('new xxxxx data') }
end
context 'hide build token' do
let(:data) { 'new token data'}
before do
build.update(token: 'token')
end
let(:data) { "new #{build.token} data"}
it { is_expected.to eq('new xxxxx data') }
it { is_expected.to match(/^new [x]+ data$/) }
end
end
......
......@@ -180,10 +180,9 @@
end
context 'runners token' do
let(:token) { 'my_secret_token' }
let(:token) { build.project.runners_token }
before do
build.project.update(runners_token: token)
trace.set(token)
end
......@@ -193,10 +192,9 @@
end
context 'hides build token' do
let(:token) { 'my_secret_token' }
let(:token) { build.token }
before do
build.update(token: token)
trace.set(token)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment