diff options
author | Keith Pope <mute.pop3+gitlab@gmail.com> | 2016-08-02 08:56:23 +0300 |
---|---|---|
committer | Keith Pope <mute.pop3+gitlab@gmail.com> | 2016-08-02 08:56:23 +0300 |
commit | 4768afbdbf85abbb5e2281c8855e7d27c07a581e (patch) | |
tree | 457ef4821e5095080a797be1d2733d00ed6c2cf3 /spec/models/key_spec.rb | |
parent | e299504b798c053817f1c866649542ac0c779924 (diff) |
Add simple identifier to public SSH keys
Diffstat (limited to 'spec/models/key_spec.rb')
-rw-r--r-- | spec/models/key_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb index 49cf3d8633a..a4d46ca84de 100644 --- a/spec/models/key_spec.rb +++ b/spec/models/key_spec.rb @@ -16,12 +16,13 @@ describe Key, models: true do end describe "Methods" do + let(:user) { create(:user) } it { is_expected.to respond_to :projects } it { is_expected.to respond_to :publishable_key } describe "#publishable_keys" do - it 'strips all personal information' do - expect(build(:key).publishable_key).not_to match(/dummy@gitlab/) + it 'replaces SSH key comment with simple identifier of username + hostname' do + expect(build(:key, user: user).publishable_key).to match(/#{Regexp.escape(user.name)} \(localhost\)/) end end end |