summaryrefslogtreecommitdiff
path: root/spec/models/key_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/key_spec.rb')
-rw-r--r--spec/models/key_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb
index 85cd291d681..9bb31a16483 100644
--- a/spec/models/key_spec.rb
+++ b/spec/models/key_spec.rb
@@ -46,4 +46,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