diff --git a/lib/hydra_wrapper.rb b/lib/hydra_wrapper.rb index 6edf54c93..bd04f53fb 100644 --- a/lib/hydra_wrapper.rb +++ b/lib/hydra_wrapper.rb @@ -8,6 +8,7 @@ require 'active_support/base64' class HydraWrapper OPTS = {:max_redirects => 3, :timeout => 25000, :method => :post, + :ssl_capath => EnviromentConfiguration.ca_cert_file_location, :headers => {'Expect' => '', 'Transfer-Encoding' => ''} } diff --git a/spec/lib/hydra_wrapper_spec.rb b/spec/lib/hydra_wrapper_spec.rb index 1218642e3..08b9fe4d8 100644 --- a/spec/lib/hydra_wrapper_spec.rb +++ b/spec/lib/hydra_wrapper_spec.rb @@ -2,7 +2,7 @@ # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. -require 'hydra_wrapper' +require 'spec_helper' describe HydraWrapper do before do @@ -74,6 +74,27 @@ describe HydraWrapper do end + describe "#insert_job" do + before do + @wrapper.hydra.stub!(:queue) + @wrapper.stub!(:prepare_request!) + end + + it 'passes the correct options' do + xml = "" + url = "blub" + Typhoeus::Request.should_receive(:new).with(url, { + :max_redirects => 3, :timeout => 25000, :method => :post, + #:ssl_capath => EnvironmentConfiguration. + :headers => {'Expect' => '', + 'Transfer-Encoding' => ''}, + :ssl_capath => EnviromentConfiguration.ca_cert_file_location, + :params => {:xml => CGI.escape(xml)} + }) + @wrapper.insert_job(url, xml, stub) + end + end + describe '#redirecting_to_https?!' do it 'does not execute unless response has a 3xx code' do resp = stub(:code => 200)