mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
fix some warning
This commit is contained in:
parent
93013c2e89
commit
b871bd5036
4 changed files with 18 additions and 11 deletions
|
@ -39,6 +39,13 @@ module Devise
|
|||
after_update :send_confirmation_instructions, :if => :reconfirmation_required?
|
||||
end
|
||||
|
||||
def initialize(*args, &block)
|
||||
@bypass_postpone = false
|
||||
@reconfirmation_required = false
|
||||
@skip_confirmation_notification = false
|
||||
super
|
||||
end
|
||||
|
||||
def self.required_fields(klass)
|
||||
required_methods = [:confirmation_token, :confirmed_at, :confirmation_sent_at]
|
||||
required_methods << :unconfirmed_email if klass.reconfirmable
|
||||
|
|
|
@ -80,9 +80,9 @@ class FailureTest < ActiveSupport::TestCase
|
|||
|
||||
test 'setup a default message' do
|
||||
call_failure
|
||||
assert_match /You are being/, @response.last.body
|
||||
assert_match /redirected/, @response.last.body
|
||||
assert_match /users\/sign_in/, @response.last.body
|
||||
assert_match(/You are being/, @response.last.body)
|
||||
assert_match(/redirected/, @response.last.body)
|
||||
assert_match(/users\/sign_in/, @response.last.body)
|
||||
end
|
||||
|
||||
test 'works for any navigational format' do
|
||||
|
|
|
@ -275,7 +275,7 @@ class ConfirmationOnChangeTest < ActionDispatch::IntegrationTest
|
|||
|
||||
visit_admin_confirmation_with_token(confirmation_token)
|
||||
assert_have_selector '#error_explanation'
|
||||
assert_contain /Confirmation token(.*)invalid/
|
||||
assert_contain(/Confirmation token(.*)invalid/)
|
||||
|
||||
visit_admin_confirmation_with_token(admin.confirmation_token)
|
||||
assert_contain 'Your account was successfully confirmed.'
|
||||
|
@ -293,7 +293,7 @@ class ConfirmationOnChangeTest < ActionDispatch::IntegrationTest
|
|||
|
||||
visit_admin_confirmation_with_token(admin.confirmation_token)
|
||||
assert_have_selector '#error_explanation'
|
||||
assert_contain /Email.*already.*taken/
|
||||
assert_contain(/Email.*already.*taken/)
|
||||
assert admin.reload.pending_reconfirmation?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,18 +6,18 @@ class SerializableTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
test 'should not include unsafe keys on XML' do
|
||||
assert_match /email/, @user.to_xml
|
||||
assert_no_match /confirmation-token/, @user.to_xml
|
||||
assert_match(/email/, @user.to_xml)
|
||||
assert_no_match(/confirmation-token/, @user.to_xml)
|
||||
end
|
||||
|
||||
test 'should not include unsafe keys on XML even if a new except is provided' do
|
||||
assert_no_match /email/, @user.to_xml(:except => :email)
|
||||
assert_no_match /confirmation-token/, @user.to_xml(:except => :email)
|
||||
assert_no_match(/email/, @user.to_xml(:except => :email))
|
||||
assert_no_match(/confirmation-token/, @user.to_xml(:except => :email))
|
||||
end
|
||||
|
||||
test 'should include unsafe keys on XML if a force_except is provided' do
|
||||
assert_no_match /<email/, @user.to_xml(:force_except => :email)
|
||||
assert_match /confirmation-token/, @user.to_xml(:force_except => :email)
|
||||
assert_no_match(/<email/, @user.to_xml(:force_except => :email))
|
||||
assert_match(/confirmation-token/, @user.to_xml(:force_except => :email))
|
||||
end
|
||||
|
||||
test 'should not include unsafe keys on JSON' do
|
||||
|
|
Loading…
Add table
Reference in a new issue