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
Allow API responses in PasswordExpiredController #111
Conversation
Pull Request Test Coverage Report for Build 726
💛 - Coveralls |
@Slike9 Thanks for your contribution, please add a link to the relevant part of the devise codebase, add some tests, and add some comments describing why this is useful. We also need to consider how this might break code that depends on the existing behavior. |
@olbrich Could you please consider my answer?
Similar code
Method The problem we are facing is the following. In our SPA-like application, we access the controller's actions via AJAX, requesting
So, we need API friendly responses to AJAX requests, not 302.
Do we need to test behavior of |
@@ -8,27 +8,39 @@ end | |||
|
|||
appraise 'rails-5.0-stable' do | |||
gem 'rails', '~> 5.0.0' | |||
group :test do | |||
gem 'rails-controller-testing' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was this gem added for? This is an outdated method of testing and generally meant to support legacy apps, not for new code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have some tests that need to run against controllers in Rails 4.2. This lets them work against rails 5+ as well.
Would love to see this get merged. Let me know if you need any help. |
In |
For API sometimes it's desirable to receive 2XX responses instead of 3XX. The same technique is used in `devise` gem.
…e trying to update the password.
c25e8e7
to
320da47
Compare
@billgloff can you elaborate a bit on how you would like the |
@olbrich how do you feel about merging this and then we can handle the request in a separate PR as desired? |
For API sometimes it's desirable to receive 2XX responses instead of
3XX. The same technique is used in
devise
gem.More about the problem addressed: #111 (comment)