Skip to content

Commit

Permalink
Add spec test for sensitive regtoken parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
arusso committed May 10, 2023
1 parent 4bd6f4a commit 8fb68d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/functions/register_to_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@

it { is_expected.to run.with_params(url, regtoken, runner_name, {}, nil, '/path/to/ca_file').and_return('Specified CA file doesn\'t exist, not attempting to create authtoken') }
end

context 'with sensitive token value' do
before do
allow(PuppetX::Gitlab::Runner).to receive(:register).with(url, { 'token' => regtoken }, nil, '/tmp').and_return(return_hash)
end

it { is_expected.to run.with_params(url, sensitive(regtoken), runner_name, {}, nil, '/tmp').and_return(return_hash['token']) }
end
end

context 'noop does not register runner and returns dummy token' do
Expand Down

0 comments on commit 8fb68d9

Please sign in to comment.