spec/certmeister/policy/key_bits_spec.rb in certmeister-2.2.0 vs spec/certmeister/policy/key_bits_spec.rb in certmeister-2.3.0
- old
+ new
@@ -23,25 +23,25 @@
response = subject.authenticate({anything: 'something'})
expect(response).to_not be_authenticated
expect(response.error).to eql "missing pem"
end
- it "refuses to authenticate an invalid request" do
- pem = File.read('fixtures/kbits_1024.csr')
+ it "refuses to authenticate an invalid pem" do
+ pem = "bad input"
response = subject.authenticate({pem: pem})
expect(response).to_not be_authenticated
- expect(response.error).to eql "weak key"
+ expect(response.error).to eql "invalid pem (not enough data)"
end
it "refuses to authenticate a request for a key with too few bits" do
- pem = File.read('fixtures/kbits_1024.csr')
+ pem = File.read('fixtures/sha256_1024bit.csr')
response = subject.authenticate({pem: pem})
expect(response).to_not be_authenticated
expect(response.error).to eql "weak key"
end
it "authenticates a request for a key with sufficient bits" do
- pem = File.read('fixtures/kbits_4096.csr')
+ pem = File.read('fixtures/sha256_4096bit.csr')
response = subject.authenticate({pem: pem})
expect(response).to be_authenticated
end
end