diff options
author | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-04-14 07:33:55 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-04-14 07:33:55 +0000 |
commit | c4202554010d0c725eb641a38bc0e73ef3797191 (patch) | |
tree | 2879f690967397f4c9e6dfcec12b5e025984d53e /spec/models | |
parent | 4632983c8c7fb7a6b7b61b89a4fbb168adb0a5b3 (diff) | |
parent | 273df6a44b5e4d501571bc2cb55dee1e5b57b290 (diff) | |
download | gitlab-ce-c4202554010d0c725eb641a38bc0e73ef3797191.tar.gz |
Merge branch 'rs-remove-invalid-key-factories' into 'master'
Remove the invalid key factories
They're only used once each, and they're easy to build in-place.
See merge request !1766
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/key_spec.rb | 13 |
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 |