spec/lib/usps_spec.rb in trackerific-0.2.1 vs spec/lib/usps_spec.rb in trackerific-0.3.0

- old
+ new

@@ -17,20 +17,18 @@ FakeWeb.register_uri( :get, USPS_TRACK_URL, :body => load_fixture(:usps_success_response) ) - @valid_response = { - :package_id => @package_id, - :summary => "Your item was delivered at 8:10 am on June 1 in Wilmington DE 19801.", - :details => [ - "May 30 11:07 am NOTICE LEFT WILMINGTON DE 19801.", - "May 30 10:08 am ARRIVAL AT UNIT WILMINGTON DE 19850.", - "May 29 9:55 am ACCEPT OR PICKUP EDGEWATER NJ 07020." - ] - } + @tracking = @usps.track_package(@package_id) end - specify { @usps.track_package(@package_id).should eq @valid_response } + specify { @tracking.should be_a Trackerific::Details } + it "should have at least one event" do + @tracking.events.length.should >= 1 + end + it "should have a summary" do + @tracking.summary.should_not be_empty + end end context "with an error response from the server" do before(:all) do FakeWeb.register_uri( :get,