diff options
Diffstat (limited to 'spec/models/key_spec.rb')
-rw-r--r-- | spec/models/key_spec.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb index fcf2cb9f30d..f4dd726331a 100644 --- a/spec/models/key_spec.rb +++ b/spec/models/key_spec.rb @@ -42,10 +42,17 @@ describe Key do build(:key, user: user).should be_valid end - it "does not accepts the key twice" do + it "does not accept the exact same key twice" do create(:key, user: user) build(:key, user: user).should_not be_valid end + + it "does not accept a duplicate key with a different comment" do + create(:key, user: user) + duplicate = build(:key, user: user) + duplicate.key << ' extra comment' + duplicate.should_not be_valid + end end context "validate it is a fingerprintable key" do |