Skip to content

Commit

Permalink
added allegro example spec to verify #349
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiii committed Jan 7, 2013
1 parent a05469a commit 4a7cd3f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions spec/integration/allegro_example_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
require "spec_helper"

describe "Allegro example" do

it "works" do
HTTPI.adapter = :net_http

client = Savon.client(
# The WSDL document provided by the service.
:wsdl => "https://webapi.allegro.pl/uploader.php?wsdl",

# Lower timeouts so these specs don't take forever when the service is not available.
:open_timeout => 10,
:read_timeout => 10,

# Not needed?
# ssl_verify_mode: :none,
# ssl_version: :TLSv1,

# Disable logging for cleaner spec output.
:log => false,

# Do not raise SOAP faults. We're using an invalid API key for this spec, so we expect
# the server to raise an error.
:raise_errors => false
)

message = { "sysver" => 1, "country-id" => 1, "webapi-key" => "WEBAPIKEY" }
response = client.call(:do_query_sys_status, message: message)

expect(response).to_not be_successful

faultcode = response.body[:fault][:faultcode]
expect(faultcode).to eq("ERR_WEBAPI_KEY")
end

end

0 comments on commit 4a7cd3f

Please sign in to comment.