Skip to content

Commit

Permalink
Add test case for '{ key => :any }' mock message
Browse files Browse the repository at this point in the history
  • Loading branch information
nathansamson authored and tjarratt committed May 26, 2015
1 parent 385f785 commit 2f82b7d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/savon/mock_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@
expect(response.http.body).to eq("<fixture/>")
end

it "can verify a request with any parameters and return a fixture response" do
message = { :username => "luke", :password => :any }
savon.expects(:authenticate).with(:message => message).returns("<fixture/>")

response = new_client.call(:authenticate) do
message(:username => "luke", :password => "secret")
end

expect(response.http.body).to eq("<fixture/>")
end

it "accepts a Hash to specify the response code, headers and body" do
soap_fault = Fixture.response(:soap_fault)
response = { :code => 500, :headers => { "X-Result" => "invalid" }, :body => soap_fault }
Expand Down

0 comments on commit 2f82b7d

Please sign in to comment.