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

Add passwordless test helpers #90

Merged
merged 3 commits into from
Nov 2, 2020
Merged

Conversation

rickychilcott
Copy link
Collaborator

This is a PR to add test helpers for test unit and rspec. I tried this locally on a project I'm using and it works ok, but I'm only using rspec. Someone who has a good example test unit project should try this or some tests can be integrated into a passwordless example app.

This takes a lot of code and ideas from #71 so no credit is taken here, just trying to pull together to get to this as part of a 1.0 release (#89).

Close #71 and address #29

Copy link
Owner

@mikker mikker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this @rickychilcott!

They'll have to be modified a bit for 1.0 but that doesn't mean they aren't a great addition. A few remarks and suggestions, otherwise looks great!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@rickychilcott
Copy link
Collaborator Author

Thanks @mikker. I made the requested changes.

I was modeling some of the syntax off of https://github.com/thoughtbot/clearance#controller-test-helpers but I looked too quickly and didn't realize that they effectively shim the current_user if you just did a sign_in without doing sign_in_as(user), so I dropped my weird overloading of the passwordless_sign_in/passwordless_sign_in(user) form.

Let me know if you'd like any other changes.

Copy link
Owner

@mikker mikker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💙💚💛💜❤️

@mikker mikker merged commit b1aca11 into mikker:master Nov 2, 2020
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

Successfully merging this pull request may close these issues.

Test helpers
2 participants