Skip to content

Commit

Permalink
Expect > 0 for shipping estimates since mass is randomized (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtbp authored Aug 3, 2022
1 parent a3de184 commit c6cfff8
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions spec/integration/estimates_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
expect(create_estimate_response.data.mass_g).to be >= 10_000
end


it 'supports creating bitcoin estimates with partial information' do
bitcoin_estimate = Patch::Estimate.create_bitcoin_estimate()

Expand Down Expand Up @@ -182,7 +181,7 @@
origin_airport: "SFO"
)
expect(air_shipping_estimate.data.type).to eq('shipping_air')
expect(air_shipping_estimate.data.mass_g).to be >= 20_000
expect(air_shipping_estimate.data.mass_g).to be > 0
end

it "supports creating an estimate with an order" do
Expand All @@ -194,8 +193,8 @@
origin_airport: "SFO"
)
expect(air_shipping_estimate.data.type).to eq('shipping_air')
expect(air_shipping_estimate.data.mass_g).to be >= 20_000
expect(air_shipping_estimate.data.order.amount).to be >= 10_000
expect(air_shipping_estimate.data.mass_g).to be > 0
expect(air_shipping_estimate.data.order.amount).to be > 0
end
end

Expand All @@ -210,7 +209,7 @@
origin_locode: "USSD2"
)
expect(rail_shipping_estimate.data.type).to eq('shipping_rail')
expect(rail_shipping_estimate.data.mass_g).to be >= 15_000
expect(rail_shipping_estimate.data.mass_g).to be > 0
end

it "supports creating an estimate using postal codes" do
Expand All @@ -225,7 +224,7 @@
origin_postal_code: "90210"
)
expect(rail_shipping_estimate.data.type).to eq('shipping_rail')
expect(rail_shipping_estimate.data.mass_g).to be >= 4_000
expect(rail_shipping_estimate.data.mass_g).to be > 0
end

it "supports creating an estimate with an order" do
Expand All @@ -236,8 +235,8 @@
origin_locode: "USSD2"
)
expect(rail_shipping_estimate.data.type).to eq('shipping_rail')
expect(rail_shipping_estimate.data.mass_g).to be >= 15_000
expect(rail_shipping_estimate.data.order.amount).to be >= 10_000
expect(rail_shipping_estimate.data.mass_g).to be > 0
expect(rail_shipping_estimate.data.order.amount).to be > 0
end
end

Expand All @@ -252,7 +251,7 @@
origin_locode: "USSD2"
)
expect(road_shipping_estimate.data.type).to eq('shipping_road')
expect(road_shipping_estimate.data.mass_g).to be >= 15_000
expect(road_shipping_estimate.data.mass_g).to be > 0
end

it "supports creating an estimate using postal codes" do
Expand All @@ -266,7 +265,7 @@
origin_postal_code: "90210"
)
expect(road_shipping_estimate.data.type).to eq('shipping_road')
expect(road_shipping_estimate.data.mass_g).to be >= 4_000
expect(road_shipping_estimate.data.mass_g).to be > 0
end

it "supports creating an estimate with an order" do
Expand All @@ -277,8 +276,8 @@
origin_locode: "USSD2"
)
expect(road_shipping_estimate.data.type).to eq('shipping_road')
expect(road_shipping_estimate.data.mass_g).to be >= 15_000
expect(road_shipping_estimate.data.order.amount).to be >= 10_000
expect(road_shipping_estimate.data.mass_g).to be > 0
expect(road_shipping_estimate.data.order.amount).to be > 0
end
end

Expand All @@ -293,7 +292,7 @@
origin_locode: "FRMRS"
)
expect(sea_shipping_estimate.data.type).to eq('shipping_sea')
expect(sea_shipping_estimate.data.mass_g).to be >= 10_000
expect(sea_shipping_estimate.data.mass_g).to be > 0
end

it "supports creating an estimate using postal codes" do
Expand All @@ -307,7 +306,7 @@
origin_postal_code: "90210"
)
expect(sea_shipping_estimate.data.type).to eq('shipping_sea')
expect(sea_shipping_estimate.data.mass_g).to be >= 4_000
expect(sea_shipping_estimate.data.mass_g).to be > 0
end

it "supports creating an estimate with an order" do
Expand All @@ -318,8 +317,8 @@
origin_locode: "USSD2"
)
expect(sea_shipping_estimate.data.type).to eq('shipping_sea')
expect(sea_shipping_estimate.data.mass_g).to be >= 15_000
expect(sea_shipping_estimate.data.order.amount).to be >= 10_000
expect(sea_shipping_estimate.data.mass_g).to be > 0
expect(sea_shipping_estimate.data.order.amount).to be > 0
end
end
end

0 comments on commit c6cfff8

Please sign in to comment.