spec/lib/fedex/track_spec.rb in fedex-3.0.0 vs spec/lib/fedex/track_spec.rb in fedex-3.1.0
- old
+ new
@@ -10,22 +10,20 @@
:package_type => "TRACKING_NUMBER_OR_DOORTAG",
:include_detailed_scans => true
}
end
- let(:uuid) { "12012~123456789012~FDEG" }
+ let(:uuid) { fedex.track(options).first.unique_tracking_number }
it "returns an array of tracking information results" do
results = fedex.track(options)
results.should_not be_empty
end
it "returns events with tracking information" do
- options[:uuid] = uuid
+ tracking_info = fedex.track(options.merge(:uuid => uuid)).first
- tracking_info = fedex.track(options).first
-
tracking_info.events.should_not be_empty
end
it "fails if using an invalid package type" do
fail_options = options
@@ -42,15 +40,13 @@
tracking_info.tracking_number.should == options[:package_id]
end
it "reports the status of the package" do
- options[:uuid] = uuid
+ tracking_info = fedex.track(options.merge(:uuid => uuid)).first
- tracking_info = fedex.track(options).first
-
- tracking_info.status.should == "In transit"
+ tracking_info.status.should == "Shipment cancelled by sender"
end
end
end
-end
\ No newline at end of file
+end