From 273df6a44b5e4d501571bc2cb55dee1e5b57b290 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 9 Apr 2015 17:16:01 -0400 Subject: Remove the invalid key factories They're only used once each, and they're easy to build in-place. --- spec/models/key_spec.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'spec/models') 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 -- cgit v1.2.1