From 64c05f2ce9e38a23867f56944e50e09fdaf00e8c Mon Sep 17 00:00:00 2001 From: Lucas Mazza Date: Wed, 22 Feb 2012 16:49:09 -0200 Subject: [PATCH] Fix the assert_same_content assertion helper and a broken confirmable test. --- test/models/confirmable_test.rb | 2 +- test/support/assertions.rb | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/test/models/confirmable_test.rb b/test/models/confirmable_test.rb index 66167bba..2659ed4a 100644 --- a/test/models/confirmable_test.rb +++ b/test/models/confirmable_test.rb @@ -342,7 +342,7 @@ class ReconfirmableTest < ActiveSupport::TestCase :confirmation_sent_at, :confirmation_token, :confirmed_at, - :unconfirmable_email + :unconfirmed_email ] end end diff --git a/test/support/assertions.rb b/test/support/assertions.rb index 95de3448..b03b2ad7 100644 --- a/test/support/assertions.rb +++ b/test/support/assertions.rb @@ -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