Skip to content

Commit

Permalink
make package a required, not keyword, argument
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpbrett committed Oct 17, 2020
1 parent 81e2f5a commit dc3c2c4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module Stock
allow(subject).to receive(:shipping_methods).and_return(shipping_methods)

expected_costs = %w[3.00 4.00 5.00].map(&BigDecimal.method(:new))
expect(subject.shipping_rates(package: package).map(&:cost)).to eq expected_costs
expect(subject.shipping_rates(package).map(&:cost)).to eq expected_costs
end

context "general shipping methods" do
Expand All @@ -91,7 +91,7 @@ module Stock

allow(subject).to receive(:shipping_methods).and_return(shipping_methods)

shipping_rates = subject.shipping_rates(package: package)
shipping_rates = subject.shipping_rates(package)
expect(shipping_rates.sort_by(&:cost).map(&:selected)).to eq [true, false]
end

Expand All @@ -103,7 +103,7 @@ module Stock

allow(subject).to receive(:shipping_methods).and_return(shipping_methods)

subject.shipping_rates(package: package)
subject.shipping_rates(package)
end
end

Expand All @@ -119,7 +119,7 @@ module Stock
allow(subject).
to receive(:shipping_methods).and_return([backend_method, generic_method])

expect(subject.shipping_rates(package: package).map(&:selected)).to eq [false, true]
expect(subject.shipping_rates(package).map(&:selected)).to eq [false, true]
end
end
end
Expand Down

0 comments on commit dc3c2c4

Please sign in to comment.