forked from matt423/ups
-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
Firstly, in connection/*_spec.rb setting up a stubbed response with:
ups-ruby/spec/ups/connection/ship_spec.rb
Lines 21 to 28 in 77175ae
| Excon.stub({:method => :post}) do |params| | |
| case params[:path] | |
| when UPS::Connection::SHIP_CONFIRM_PATH | |
| {body: File.read("#{stub_path}/ship_confirm_success.xml"), status: 200} | |
| when UPS::Connection::SHIP_ACCEPT_PATH | |
| {body: File.read("#{stub_path}/ship_accept_success.xml"), status: 200} | |
| end | |
| end |
just matches on the request URL path, then returns a canned response. The specs just check against what was in the canned response.
In effect they're only testing the response parsing, instead of the request. Is this ok?
Second, the XML schema validation:
ups-ruby/spec/ups/builders/ship_confirm_builder_spec.rb
Lines 20 to 22 in 77175ae
| def test_validates_against_xsd | |
| assert_passes_validation schema_path('ShipConfirmRequest.xsd'), @ship_confirm_builder.to_xml | |
| end |
appears to me to do nothing. Mutilating the XML that is generated in the builders results in no failure. How is this supposed to work?
Metadata
Metadata
Assignees
Labels
No labels