Closed fredericboivin closed 8 years ago
LGTM :+1:
@dangerdogz This is a great start for improving the tests. Aside from the few style comments I am :+1: on the direction for this.
Good feeback. I share the style concerns and I'll get started on cleaning up with the new syntax
I did a first pass on the active_shipping_spec, still need to sort the stock_location part but otherwise it looks better. I very much enjoy the process since learning to write good tests is definitely where I have the most work to do. (also cleaned it up a little with rubocop)
@dangerdogz That looks great. Thanks so much for all your work on this!
I've cleaned up the stub usage in the usps spec since it was copy pasted from active_shipping_calculator_spec.
Since we're using a real calculator with a real carrier, the only thing we need to stub is the HTTP call since we're using a fixture.
:+1:
active_shipping_calculator_spec.rb is in a weird state since it's testing with a USPS calculators, who decorates the base methods like find_rates from active_shipping/base.rb
So this PR is to :
1) Restore the use of bogus carrier / calculator in the active_shipping_calculator_spec to unit tests the code present in active_shipping/base.rb
2) Extract the USPS specific code into a new carrier spec as a first step