diff options
author | Rubén Dávila <ruben@gitlab.com> | 2018-02-12 12:39:47 -0500 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2018-02-12 12:39:47 -0500 |
commit | 740499bab5524d490218fd36033402cf67ec49f0 (patch) | |
tree | f1d0f12360823fc75b79fe873d1c7f89bdf66bf9 /spec/lib/gitlab/ssh_public_key_spec.rb | |
parent | 80c1626b2776b300acaaee85d11012b96893d004 (diff) | |
download | gitlab-ce-740499bab5524d490218fd36033402cf67ec49f0.tar.gz |
Revert "Merge branch 'rd-40552-gitlab-should-check-if-keys-are-valid-before-saving' into 'master'"rd-43185-revert-sanitize-extra-blank-spaces-used-when-uploading-a-ssh-key
This reverts commit a58f8c32c62bcf5824d1fe1d0de53e9bda974d65, reversing
changes made to cd5d75c362cdf06efb8174eddfbd0f4b65687dec.
Diffstat (limited to 'spec/lib/gitlab/ssh_public_key_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ssh_public_key_spec.rb | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/spec/lib/gitlab/ssh_public_key_spec.rb b/spec/lib/gitlab/ssh_public_key_spec.rb index c15e29774b6..93d538141ce 100644 --- a/spec/lib/gitlab/ssh_public_key_spec.rb +++ b/spec/lib/gitlab/ssh_public_key_spec.rb @@ -37,41 +37,6 @@ describe Gitlab::SSHPublicKey, lib: true do end end - describe '.sanitize(key_content)' do - let(:content) { build(:key).key } - - context 'when key has blank space characters' do - it 'removes the extra blank space characters' do - unsanitized = content.insert(100, "\n") - .insert(40, "\r\n") - .insert(30, ' ') - - sanitized = described_class.sanitize(unsanitized) - _, body = sanitized.split - - expect(sanitized).not_to eq(unsanitized) - expect(body).not_to match(/\s/) - end - end - - context "when key doesn't have blank space characters" do - it "doesn't modify the content" do - sanitized = described_class.sanitize(content) - - expect(sanitized).to eq(content) - end - end - - context "when key is invalid" do - it 'returns the original content' do - unsanitized = "ssh-foo any content==" - sanitized = described_class.sanitize(unsanitized) - - expect(sanitized).to eq(unsanitized) - end - end - end - describe '#valid?' do subject { public_key } |