diff options
author | Valeriy Sizov <vsv2711@gmail.com> | 2012-10-03 03:18:08 -0700 |
---|---|---|
committer | Valeriy Sizov <vsv2711@gmail.com> | 2012-10-03 03:18:08 -0700 |
commit | b5f9d29f55e1fbf302bd824e2d08c0885caa15d7 (patch) | |
tree | abeb98c3a421d4b6674f5b6892bddf63e1bc4097 /spec/models/key_spec.rb | |
parent | 4cbfe9427ba84a05a444373809a6b7aa7906db34 (diff) | |
parent | 7284c58c5fb54965b078a2ba9e3634479700416d (diff) | |
download | gitlab-ce-b5f9d29f55e1fbf302bd824e2d08c0885caa15d7.tar.gz |
Merge pull request #1617 from dosire/reject-ssh-keys-that-break-gitolite
Reject ssh keys that break gitolite
Diffstat (limited to 'spec/models/key_spec.rb')
-rw-r--r-- | spec/models/key_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb index 3ccfdf034de..169bd890c3d 100644 --- a/spec/models/key_spec.rb +++ b/spec/models/key_spec.rb @@ -51,4 +51,16 @@ describe Key do end end end + + context "validate it is a fingerprintable key" do + let(:user) { Factory.create(:user) } + + it "accepts the fingerprintable key" do + build(:key, user: user).should be_valid + end + + it "rejects the unfingerprintable key" do + build(:key_with_a_space_in_the_middle).should_not be_valid + end + end end |