spec/http_spec.rb in r509-ca-http-0.3.0 vs spec/http_spec.rb in r509-ca-http-0.3.1
- old
+ new
@@ -242,11 +242,11 @@
post "/1/certificate/revoke", "ca" => "test_ca", "serial" => "12345"
last_response.should be_ok
last_response.body.should == "generated crl"
end
it "when serial and reason are given" do
- @crls["test_ca"].should_receive(:revoke_cert).with("12345", "1").and_return(nil)
+ @crls["test_ca"].should_receive(:revoke_cert).with("12345", 1).and_return(nil)
crl_obj = double("crl-obj")
@crls["test_ca"].should_receive(:generate_crl).and_return(crl_obj)
crl_obj.should_receive(:to_pem).and_return("generated crl")
post "/1/certificate/revoke", "ca" => "test_ca", "serial" => "12345", "reason" => "1"
last_response.should be_ok
@@ -257,10 +257,10 @@
post "/1/certificate/revoke", "ca" => "test_ca", "serial" => "foo"
last_response.should_not be_ok
last_response.body.should == "#<R509::R509Error: some r509 error>"
end
it "when reason is not an integer" do
- @crls["test_ca"].should_receive(:revoke_cert).with("12345", "foo").and_return(nil)
+ @crls["test_ca"].should_receive(:revoke_cert).with("12345", 0).and_return(nil)
crl_obj = double("crl-obj")
@crls["test_ca"].should_receive(:generate_crl).and_return(crl_obj)
crl_obj.should_receive(:to_pem).and_return("generated crl")
post "/1/certificate/revoke", "ca" => "test_ca", "serial" => "12345", "reason" => "foo"
last_response.should be_ok