summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-09-13 22:51:41 +0000
committerStan Hu <stanhu@gmail.com>2016-09-13 22:51:41 +0000
commit746bf485bc1ef7a7e46eda80ff6b450a14e5bf1d (patch)
tree0f2e3ce12e55c2e803ed91f4bc97a9ee35aac497 /spec
parentacc7f7c6c19d70f37bea30ccc7e9469438959055 (diff)
parent11f54caada4baaf8fb179213b1a93aa1a047f9b3 (diff)
downloadgitlab-ce-746bf485bc1ef7a7e46eda80ff6b450a14e5bf1d.tar.gz
Merge branch 'workhorse-secret-trailing-newline' into 'master'
Allow trailing newline in secret base64 data Fixes https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1575 See merge request !6327
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/workhorse_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/lib/gitlab/workhorse_spec.rb b/spec/lib/gitlab/workhorse_spec.rb
index 395192149a9..6c7fa7e7c15 100644
--- a/spec/lib/gitlab/workhorse_spec.rb
+++ b/spec/lib/gitlab/workhorse_spec.rb
@@ -30,6 +30,11 @@ describe Gitlab::Workhorse, lib: true do
expect(subject.encoding).to eq(Encoding::ASCII_8BIT)
end
+ it 'accepts a trailing newline' do
+ open(described_class.secret_path, 'a') { |f| f.write "\n" }
+ expect(subject.length).to eq(32)
+ end
+
it 'raises an exception if the secret file cannot be read' do
File.delete(described_class.secret_path)
expect { subject }.to raise_exception(Errno::ENOENT)