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 ...@@ -769,33 +769,15 @@ describe Ci::Build do
let(:subject) { build.hide_secrets(data) } let(:subject) { build.hide_secrets(data) }
context 'hide runners token' do context 'hide runners token' do
let(:data) { 'new token data'} let(:data) { "new #{project.runners_token} data"}
before do it { is_expected.to match(/^new [x]+ data$/) }
build.project.update(runners_token: 'token')
end
it { is_expected.to eq('new xxxxx data') }
end end
context 'hide build token' do context 'hide build token' do
let(:data) { 'new token data'} let(:data) { "new #{build.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
it { is_expected.to eq('new xxxxx data') } it { is_expected.to match(/^new [x]+ data$/) }
end end
end end
......
...@@ -180,10 +180,9 @@ shared_examples_for 'common trace features' do ...@@ -180,10 +180,9 @@ shared_examples_for 'common trace features' do
end end
context 'runners token' do context 'runners token' do
let(:token) { 'my_secret_token' } let(:token) { build.project.runners_token }
before do before do
build.project.update(runners_token: token)
trace.set(token) trace.set(token)
end end
...@@ -193,10 +192,9 @@ shared_examples_for 'common trace features' do ...@@ -193,10 +192,9 @@ shared_examples_for 'common trace features' do
end end
context 'hides build token' do context 'hides build token' do
let(:token) { 'my_secret_token' } let(:token) { build.token }
before do before do
build.update(token: token)
trace.set(token) trace.set(token)
end 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