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:
authorRobert Speicher <rspeicher@gmail.com>2015-04-10 00:16:01 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-04-12 00:12:10 +0300
commit273df6a44b5e4d501571bc2cb55dee1e5b57b290 (patch)
tree84883d61f559abf77b06ea97fbaab9e85202adfd /spec/models/key_spec.rb
parent5155b9794db107bdb44297a7c01ced13581ee303 (diff)
Remove the invalid key factories
They're only used once each, and they're easy to build in-place.
Diffstat (limited to 'spec/models/key_spec.rb')
-rw-r--r--spec/models/key_spec.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb
index a212b95a7d6..2fb651bef1b 100644
--- a/spec/models/key_spec.rb
+++ b/spec/models/key_spec.rb
@@ -58,12 +58,17 @@ describe Key do
expect(build(:key)).to be_valid
end
- it "rejects the unfingerprintable key (contains space in middle)" do
- expect(build(:key_with_a_space_in_the_middle)).not_to be_valid
+ it 'rejects an unfingerprintable key that contains a space' do
+ key = build(:key)
+
+ # Not always the middle, but close enough
+ key.key = key.key[0..100] + ' ' + key.key[100..-1]
+
+ expect(key).not_to be_valid
end
- it "rejects the unfingerprintable key (not a key)" do
- expect(build(:invalid_key)).not_to be_valid
+ it 'rejects the unfingerprintable key (not a key)' do
+ expect(build(:key, key: 'ssh-rsa an-invalid-key==')).not_to be_valid
end
end