Fix the assert_same_content assertion helper

and a broken confirmable test.
This commit is contained in:
Lucas Mazza 2012-02-22 16:49:09 -02:00
parent c5cb60a752
commit 64c05f2ce9
2 changed files with 4 additions and 5 deletions

View File

@ -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

View File

@ -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