thoughtbot / carnival

An unobtrusive, developer-friendly way to add comments
MIT License
499 stars 30 forks source link

Extract, improve, and test authenticateUser #190

Closed pbrisbin closed 9 years ago

pbrisbin commented 9 years ago

This code has actually been a source of bugs. With the new scaffold's Import.NoFoundation, we're able to extract more code out of Foundation without running into circular imports. Moving this to Model.User made it easy to test.

pbrisbin commented 9 years ago

/cc @gabebw

jferris commented 9 years ago

This looks like an improvement to me. Did the behavior change here, or is this just a refactoring?

Nice to know about Import.NoFoundation.

pbrisbin commented 9 years ago

Nope, no behavior change. I wanted to refactor a bit as I pulled this example into a blog post, then I noticed I could get some test coverage on it first.

pbrisbin commented 9 years ago

This'll be useful when we introduce other authentication plugins, to be able to test the logic of handling credsExtra from multiple sources.