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

Guides around integration testing #325

Closed
joshchernoff opened this issue Nov 15, 2019 · 2 comments
Closed

Guides around integration testing #325

joshchernoff opened this issue Nov 15, 2019 · 2 comments

Comments

@joshchernoff
Copy link
Contributor

While I think it does not make sense to directly test the interface of pow, I do feel like testing integration of pow in an app in question is important.

I was curious about your thoughts on this matter.

How do you currently test the integration of pow? Is there a best practice on this? I typically try to stay away from acceptance tests due to the heavy requirement of a headless browser and tendency for being slow running.

@danschultzer
Copy link
Collaborator

This is enough for most use cases: https://github.com/danschultzer/pow#testing-with-authenticated-users

With #230 I aim to cover all custom setup with unit tests. Apart from that I don't think it's necessary to add any integration tests, since controller tests already will call Pow plugs, and Ecto tests will (likely) call the Pow changeset.

In most cases you should only test the logic in your app. There may be a few scenarios where you got some unique configuration of a third-party app that's vital. That's also why I try to force developers to configure Pow with code rather than handling it with config options, so it's much easier to identity what needs to be tested.

This might be interesting to see what a deeper dive with testing Pow on custom setup looks like: #311 sprung from #271 (comment)

@joshchernoff
Copy link
Contributor Author

Very cool thanks for sharing the links.

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

No branches or pull requests

2 participants