Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make EventWithContextFactory publicly accessible #274

Open
loicginoux opened this issue Apr 5, 2023 · 3 comments
Open

Make EventWithContextFactory publicly accessible #274

loicginoux opened this issue Apr 5, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@loicginoux
Copy link
Contributor

loicginoux commented Apr 5, 2023

Would it be possible to move spec/support/solidus_stripe/webhook/event_with_context_factory to lib/solidus_stripe/testing_support/factories ?

When adding tests to my app for some stripe events (either if overwritting or adding new events handlers), it would be great if I could use the class SolidusStripe::Webhook::EventWithContextFactory that makes tests for subscribers really easy to write.

The only solution I found for now: (taken from here)

gem_dir = Gem::Specification.find_by_name("solidus_stripe").gem_dir
require "#{gem_dir}/spec/support/solidus_stripe/webhook/event_with_context_factory"
@loicginoux loicginoux added the enhancement New feature or request label Apr 5, 2023
@elia
Copy link
Member

elia commented Apr 5, 2023

@loicginoux right now that file would be copied to the target app upon installation, but maybe there's a case for moving it to lib/ as you suggested. Alternatively we could maybe make the installer have an option for installing specific parts, like just the specs and so on. Thoughts?

@elia elia changed the title make accessible EventWithContextFactory publicly Make EventWithContextFactory publicly accessible Apr 5, 2023
@loicginoux
Copy link
Contributor Author

ah maybe I haven't checked master version of solidus_stripe. I am locked for now at

gem "solidus_stripe", github: "solidusio/solidus_stripe", ref: "c8ef569ccd04dd73ad09a1966f7a6a0206793cff"

and missed the part where it is now a file copied to main app. If this is the case, then this can be closed

@waiting-for-dev
Copy link
Contributor

@elia, if I'm not wrong, the file won't be copied unless the private specs=all option is given during installation. Moving it to the lib/ folder probably makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants