Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix tests running under Rails 3.1 and 3.2

AM::TestCase and AV::TestCase have different semantics in 3.2, so add checks.
  • Loading branch information...
commit cdd8a58bf534fb989f7ffce1144b98faf30c68b1 1 parent afaea76
@blowmage authored
View
14 test/rails/action_mailer/test_mailers.rb
@@ -6,6 +6,7 @@
class TestTestMailer < ActionMailer::Base; end
+# From Rails...
class CrazyNameMailerTest < MiniTest::Rails::ActionMailer::TestCase
tests TestTestMailer
@@ -20,7 +21,7 @@ class CrazySymbolNameMailerTest < MiniTest::Rails::ActionMailer::TestCase
def test_set_mailer_class_manual_using_symbol
assert_equal TestTestMailer, self.class.mailer_class
end
-end
+end if Rails::VERSION::STRING >= "3.2"
class CrazyStringNameMailerTest < MiniTest::Rails::ActionMailer::TestCase
tests 'test_test_mailer'
@@ -28,8 +29,9 @@ class CrazyStringNameMailerTest < MiniTest::Rails::ActionMailer::TestCase
def test_set_mailer_class_manual_using_string
assert_equal TestTestMailer, self.class.mailer_class
end
-end
+end if Rails::VERSION::STRING >= "3.2"
+# New tests...
describe TestTestMailer do
it "gets the mailer from the test name" do
assert_equal TestTestMailer, self.class.mailer_class
@@ -76,7 +78,7 @@ def test_set_mailer_class_manual_using_string
it "gets the mailer after setting it with a symbol" do
assert_equal TestTestMailer, self.class.mailer_class
end
-end
+end if Rails::VERSION::STRING >= "3.2"
describe "AnotherCrazyStringNameMailerTest" do
tests 'test_test_mailer'
@@ -84,7 +86,7 @@ def test_set_mailer_class_manual_using_string
it "gets the mailer after setting it with a string" do
assert_equal TestTestMailer, self.class.mailer_class
end
-end
+end if Rails::VERSION::STRING >= "3.2"
describe "Another Crazy Name Mailer Test" do
tests TestTestMailer
@@ -100,7 +102,7 @@ def test_set_mailer_class_manual_using_string
it "gets the mailer after setting it with a symbol" do
assert_equal TestTestMailer, self.class.mailer_class
end
-end
+end if Rails::VERSION::STRING >= "3.2"
describe "Another Crazy String Name Mailer Test" do
tests 'test_test_mailer'
@@ -108,4 +110,4 @@ def test_set_mailer_class_manual_using_string
it "gets the mailer after setting it with a string" do
assert_equal TestTestMailer, self.class.mailer_class
end
-end
+end if Rails::VERSION::STRING >= "3.2"
View
4 test/rails/action_view/test_helpers.rb
@@ -36,7 +36,7 @@ class CrazySymbolHelperTest < MiniTest::Rails::ActionView::TestCase
def test_set_helper_class_using_symbol
assert_equal PeopleHelper, self.class.helper_class
end
-end
+end if Rails::VERSION::STRING >= "3.2"
class CrazyStringHelperTest < MiniTest::Rails::ActionView::TestCase
tests 'people'
@@ -44,7 +44,7 @@ class CrazyStringHelperTest < MiniTest::Rails::ActionView::TestCase
def test_set_helper_class_using_string
assert_equal PeopleHelper, self.class.helper_class
end
-end
+end if Rails::VERSION::STRING >= "3.2"
# New tests...
describe PeopleHelper do
Please sign in to comment.
Something went wrong with that request. Please try again.