summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-07-11 16:14:28 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-07-11 16:14:28 +0000
commitc7c630f142a23505b4adce449c0a176dec142384 (patch)
tree68025fd231a6f436bff5cf9d8f18c120660831be /spec
parent7bebf9833df83afdb4a83ea5a9c73e9e22225c6e (diff)
parentca692fbcc1b639ea599b5d0fdf80e90e7a6aa5bf (diff)
downloadgitlab-ce-c7c630f142a23505b4adce449c0a176dec142384.tar.gz
Merge branch 'fix-no-method-error-on-nil' into 'master'
Fix an exception seen using the online terminal See merge request gitlab-org/gitlab-ce!18299
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/kubernetes_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/kubernetes_spec.rb b/spec/lib/gitlab/kubernetes_spec.rb
index 34b33772578..5c03a2ce7d3 100644
--- a/spec/lib/gitlab/kubernetes_spec.rb
+++ b/spec/lib/gitlab/kubernetes_spec.rb
@@ -70,4 +70,19 @@ describe Gitlab::Kubernetes do
it { is_expected.to eq(YAML.load_file(path)) }
end
end
+
+ describe '#add_terminal_auth' do
+ it 'adds authentication parameters to a hash' do
+ terminal = { original: 'value' }
+
+ add_terminal_auth(terminal, token: 'foo', max_session_time: 0, ca_pem: 'bar')
+
+ expect(terminal).to eq(
+ original: 'value',
+ headers: { 'Authorization' => ['Bearer foo'] },
+ max_session_time: 0,
+ ca_pem: 'bar'
+ )
+ end
+ end
end