Fix the assert_same_content assertion helper
and a broken confirmable test.
This commit is contained in:
parent
c5cb60a752
commit
64c05f2ce9
|
@ -342,7 +342,7 @@ class ReconfirmableTest < ActiveSupport::TestCase
|
||||||
:confirmation_sent_at,
|
:confirmation_sent_at,
|
||||||
:confirmation_token,
|
:confirmation_token,
|
||||||
:confirmed_at,
|
:confirmed_at,
|
||||||
:unconfirmable_email
|
:unconfirmed_email
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,11 +25,10 @@ class ActiveSupport::TestCase
|
||||||
assert_no_difference('ActionMailer::Base.deliveries.size') { yield }
|
assert_no_difference('ActionMailer::Base.deliveries.size') { yield }
|
||||||
end
|
end
|
||||||
|
|
||||||
def assert_same_content(expected, result)
|
def assert_same_content(result, expected)
|
||||||
assert expected.size == result.size, "the arrays doesn't have the same content"
|
assert expected.size == result.size, "the arrays doesn't have the same size"
|
||||||
expected.each do |element|
|
expected.each do |element|
|
||||||
result.index(element)
|
assert result.include?(element), "The array doesn't include '#{element}'."
|
||||||
assert !element.nil?, "the arrays doesn't have the same content"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue