Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSytse Sijbrandij <sytse@dosire.com>2012-09-21 20:22:43 +0400
committerSytse Sijbrandij <sytse@dosire.com>2012-09-24 18:48:10 +0400
commitf3ce02b5c944e5956eb7208506ec513623d092d8 (patch)
treedd2af9f7083fbcb2ccb75988d31607fa7953c195 /spec/models
parent8f9a450eedc5b5fc13e24788ab67f2de928dd83a (diff)
Reject ssh keys that break gitolite.
Failing test. Working check.
Diffstat (limited to 'spec/models')
-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