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_token,
:confirmed_at,
:unconfirmable_email
:unconfirmed_email
]
end
end

View File

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