mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Update devise to version 5.0 (#37419)
This commit is contained in:
@@ -70,7 +70,7 @@ RSpec.describe Auth::SessionsController do
|
||||
end
|
||||
|
||||
it 'shows a login error and does not log the user in' do
|
||||
expect(flash[:alert]).to match I18n.t('devise.failure.invalid', authentication_keys: I18n.t('activerecord.attributes.user.email'))
|
||||
expect(flash[:alert]).to match(/#{failure_message_invalid_email}/i)
|
||||
|
||||
expect(controller.current_user).to be_nil
|
||||
end
|
||||
@@ -163,7 +163,7 @@ RSpec.describe Auth::SessionsController do
|
||||
end
|
||||
|
||||
it 'shows a login error and does not log the user in' do
|
||||
expect(flash[:alert]).to match I18n.t('devise.failure.invalid', authentication_keys: I18n.t('activerecord.attributes.user.email'))
|
||||
expect(flash[:alert]).to match(/#{failure_message_invalid_email}/i)
|
||||
|
||||
expect(controller.current_user).to be_nil
|
||||
end
|
||||
@@ -420,5 +420,9 @@ RSpec.describe Auth::SessionsController do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def failure_message_invalid_email
|
||||
I18n.t('devise.failure.invalid', authentication_keys: I18n.t('activerecord.attributes.user.email'))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ RSpec.describe 'Log in' do
|
||||
it 'A invalid email and password user is not able to log in' do
|
||||
fill_in_auth_details('invalid_email', 'invalid_password')
|
||||
|
||||
expect(subject).to have_css('.flash-message', text: failure_message('invalid'))
|
||||
expect(subject).to have_css('.flash-message', text: /#{failure_message_invalid}/i)
|
||||
end
|
||||
|
||||
context 'when confirmed at is nil' do
|
||||
@@ -38,8 +38,8 @@ RSpec.describe 'Log in' do
|
||||
end
|
||||
end
|
||||
|
||||
def failure_message(message)
|
||||
def failure_message_invalid
|
||||
keys = User.authentication_keys.map { |key| User.human_attribute_name(key) }
|
||||
I18n.t("devise.failure.#{message}", authentication_keys: keys.join('support.array.words_connector'))
|
||||
I18n.t('devise.failure.invalid', authentication_keys: keys.join('support.array.words_connector'))
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user