Remove `assert_nothing_raised` deprecated usage.
This commit is contained in:
parent
a20cca6873
commit
656720583f
|
@ -94,7 +94,7 @@ class SessionsControllerTest < Devise::ControllerTestCase
|
||||||
User.class_eval { attr_protected :email }
|
User.class_eval { attr_protected :email }
|
||||||
|
|
||||||
begin
|
begin
|
||||||
assert_nothing_raised ActiveModel::MassAssignmentSecurity::Error do
|
assert_nothing_raised do
|
||||||
get :new, user: { email: "allez viens!" }
|
get :new, user: { email: "allez viens!" }
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
|
|
|
@ -67,18 +67,18 @@ class DeviseTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'add new module using the helper method' do
|
test 'add new module using the helper method' do
|
||||||
assert_nothing_raised(Exception) { Devise.add_module(:coconut) }
|
Devise.add_module(:coconut)
|
||||||
assert_equal 1, Devise::ALL.select { |v| v == :coconut }.size
|
assert_equal 1, Devise::ALL.select { |v| v == :coconut }.size
|
||||||
refute Devise::STRATEGIES.include?(:coconut)
|
refute Devise::STRATEGIES.include?(:coconut)
|
||||||
refute defined?(Devise::Models::Coconut)
|
refute defined?(Devise::Models::Coconut)
|
||||||
Devise::ALL.delete(:coconut)
|
Devise::ALL.delete(:coconut)
|
||||||
|
|
||||||
assert_nothing_raised(Exception) { Devise.add_module(:banana, strategy: :fruits) }
|
Devise.add_module(:banana, strategy: :fruits)
|
||||||
assert_equal :fruits, Devise::STRATEGIES[:banana]
|
assert_equal :fruits, Devise::STRATEGIES[:banana]
|
||||||
Devise::ALL.delete(:banana)
|
Devise::ALL.delete(:banana)
|
||||||
Devise::STRATEGIES.delete(:banana)
|
Devise::STRATEGIES.delete(:banana)
|
||||||
|
|
||||||
assert_nothing_raised(Exception) { Devise.add_module(:kivi, controller: :fruits) }
|
Devise.add_module(:kivi, controller: :fruits)
|
||||||
assert_equal :fruits, Devise::CONTROLLERS[:kivi]
|
assert_equal :fruits, Devise::CONTROLLERS[:kivi]
|
||||||
Devise::ALL.delete(:kivi)
|
Devise::ALL.delete(:kivi)
|
||||||
Devise::CONTROLLERS.delete(:kivi)
|
Devise::CONTROLLERS.delete(:kivi)
|
||||||
|
|
|
@ -112,7 +112,7 @@ class CheckFieldsTest < ActiveSupport::TestCase
|
||||||
attr_accessor :encrypted_password, :email
|
attr_accessor :encrypted_password, :email
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_nothing_raised Devise::Models::MissingAttribute do
|
assert_nothing_raised do
|
||||||
Devise::Models.check_fields!(Player)
|
Devise::Models.check_fields!(Player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue