mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-10 08:08:00 -05:00
Merge pull request #1675 from plataformatec/fix_assertion
Fix the assert_same_content assertion helper
This commit is contained in:
@@ -342,7 +342,7 @@ class ReconfirmableTest < ActiveSupport::TestCase
|
||||
:confirmation_sent_at,
|
||||
:confirmation_token,
|
||||
:confirmed_at,
|
||||
:unconfirmable_email
|
||||
:unconfirmed_email
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -25,11 +25,10 @@ class ActiveSupport::TestCase
|
||||
assert_no_difference('ActionMailer::Base.deliveries.size') { yield }
|
||||
end
|
||||
|
||||
def assert_same_content(expected, result)
|
||||
assert expected.size == result.size, "the arrays doesn't have the same content"
|
||||
def assert_same_content(result, expected)
|
||||
assert expected.size == result.size, "the arrays doesn't have the same size"
|
||||
expected.each do |element|
|
||||
result.index(element)
|
||||
assert !element.nil?, "the arrays doesn't have the same content"
|
||||
assert result.include?(element), "The array doesn't include '#{element}'."
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user