summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-04-09 17:16:01 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-04-11 17:12:10 -0400
commit273df6a44b5e4d501571bc2cb55dee1e5b57b290 (patch)
tree84883d61f559abf77b06ea97fbaab9e85202adfd /spec/models
parent5155b9794db107bdb44297a7c01ced13581ee303 (diff)
downloadgitlab-ce-273df6a44b5e4d501571bc2cb55dee1e5b57b290.tar.gz
Remove the invalid key factories
They're only used once each, and they're easy to build in-place.
Diffstat (limited to 'spec/models')
-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