-
Notifications
You must be signed in to change notification settings - Fork 12
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
Update devise #242
base: master
Are you sure you want to change the base?
Update devise #242
Conversation
14cb6a8
to
adffc6f
Compare
Devise 4.0.0 introduced support for Rails 5 Follow up commits will fix deprecations
Devise updated this in version 4.0.0rc1, so this is just bringing us up to the new system: https://github.com/heartcombo/devise/blob/main/CHANGELOG.md#400rc1---2016-02-01
Devise 4.1.0 fixed a race condition with email sending, where an email could try to be sent before the record that email is referring too is not yet persisted [1]. They unfortunately fixed this using an after_commit, which under Rails 4.2 doesn't work with transactional fixtures [2]. This is fixed under Rails 5 [3], so we can just comment these out to get this merged, and get the rails upgrade out, then re-enable these tests. [1] https://github.com/heartcombo/devise/blob/main/CHANGELOG.md#410 [2] config/spec_helper.rb:34 [3] rails/rails@eb72e34
Devise 4.6.0 deprecated the `devise_error_messages!` helper method in favour if just rendering a partial including the library. [1] We can (optionally) copy that partial into our codebase, where we can edit it, and it will be preferentially used over the one in the gem code. However, the existing helper had no customisations so I didn't go down that route yet. [1] https://github.com/heartcombo/devise/blob/main/CHANGELOG.md#460---2019-02-07
Devise 4.2.0 deprecated the Devise::TestHelpers module in favour of the Devise::Test::ControllerHelpers module, which is because they wanted to split the different test helpers into different modules. https://github.com/heartcombo/devise/blob/main/CHANGELOG.md#420---2016-07-01
adffc6f
to
9bedc8e
Compare
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.
Seems fine to me, other than the lint issues. I have slight preference to using test_after_commit over commenting out the specs, but I don't feel particularly strongly about it.
@@ -1,30 +1,36 @@ | |||
require 'spec_helper' | |||
|
|||
describe Accounts::RegistrationsController do | |||
it "can get signup form" do | |||
it 'can get signup form' do |
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.
Is there a particular reason for changing to single quotes? standardrb seems to prefer double quotes:
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping
post :create, :user => { :username => "signup_username", :name => "Mr. SignUp", :email => "[email protected]", :password => "password", :password_confirmation => "password" } | ||
end.to change{User.count}.by(1) | ||
post :create, | ||
user: { username: 'signup_username', name: 'Mr. SignUp', email: '[email protected]', password: 'password', |
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.
This also fails lint:
Layout/ArgumentAlignment: Use one level of indentation for arguments following the first line of a multi-line method call
Required for Rails 5