Skip to content

Commit

Permalink
update response_spec to use faraday logic
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeIGS committed Jan 4, 2024
1 parent e024205 commit 69e68bf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spec/savon/response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,16 @@
end

describe "#http" do
it "should return the HTTPI::Response" do
expect(soap_response.http).to be_an(HTTPI::Response)
it "should return the Faraday::Response" do
expect(soap_response.http).to be_an(Faraday::Response)
end
end

def soap_response(options = {})
defaults = { :code => 200, :headers => {}, :body => Fixture.response(:authentication) }
response = defaults.merge options
http_response = HTTPI::Response.new(response[:code], response[:headers], response[:body])
env = Faraday::Env.new(status: response[:code], response_headers: response[:headers], response_body: response[:body])
http_response = Faraday::Response.new(env)

Savon::Response.new(http_response, globals, locals)
end
Expand All @@ -268,7 +269,8 @@ def http_error_response
def invalid_soap_response(options = {})
defaults = { :code => 200, :headers => {}, :body => "I'm not SOAP" }
response = defaults.merge options
http_response = HTTPI::Response.new(response[:code], response[:headers], response[:body])
env = Faraday::Env.new(status: response[:code], response_headers: response[:headers], response_body: response[:body])
http_response = Faraday::Response.new(env)

Savon::Response.new(http_response, globals, locals)
end
Expand Down

0 comments on commit 69e68bf

Please sign in to comment.