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 @@ ...@@ -769,33 +769,15 @@
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 @@ ...@@ -180,10 +180,9 @@
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 @@ ...@@ -193,10 +192,9 @@
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