SuperGoodSoft / solidus_taxjar

Support for using TaxJar to handle tax calculations in Solidus
BSD 3-Clause "New" or "Revised" License
12 stars 12 forks source link

Load factories in line with new Solidus conventions #231

Closed forkata closed 1 year ago

forkata commented 1 year ago

This change updates our extension to use the new method provided by solidus_dev_support instead of manually requiring the files. This is in line with how FactoryBot recommends factories are registered and resolves an issue with our custom override for the Spree::Address factory.

Currently the upstream version of solidus_dev_support does not handle our use case of having a two folder deep namespace, so this change needs to wait for that to be fixed. We have opened a PR upstream for that to be changed.

UPDATE: The PR above has been merged, but we have to wait for an official release for solidus_dev_support and upgrade to that before we can merge this.

UPDATE 2: solidus_dev_support 2.7.0 was released with our fix for namespaced extensions https://github.com/solidusio/solidus_dev_support/releases/tag/v2.7.0

This removes the workaround we introduced when we initially resolved #230.

What is the goal of this PR?

Ensure that our extension loads factories in the recommended way. Also ensure that our factory override works.

We've also added some documentation for how to load the factories from this extension into a host application for testing.

How do you manually test these changes? (if applicable)

  1. Run the test suite
    • [x] Assert all tests pass against supported Solidus versions

Merge Checklist