Commit 0a611caa authored by Grzegorz Bizon's avatar Grzegorz Bizon

Improve specs for hiding runners tokens in traces

parent 747a5c42
......@@ -769,33 +769,15 @@ describe Ci::Build do
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 @@ shared_examples_for 'common trace features' do
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 @@ shared_examples_for 'common trace features' do
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