From a6c60222c580e4002152b1ac1857673038b1fd42 Mon Sep 17 00:00:00 2001 From: Arun Agrawal Date: Sun, 4 Sep 2011 08:24:02 +0530 Subject: Modified content in guides and comments for "assert /" warnings. Removed because if somebody will use this code they will get warnings! --- railties/guides/source/action_mailer_basics.textile | 4 ++-- railties/guides/source/testing.textile | 2 +- railties/lib/rails/generators/test_case.rb | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'railties') diff --git a/railties/guides/source/action_mailer_basics.textile b/railties/guides/source/action_mailer_basics.textile index 351a4498b1..67761645fa 100644 --- a/railties/guides/source/action_mailer_basics.textile +++ b/railties/guides/source/action_mailer_basics.textile @@ -514,8 +514,8 @@ class UserMailerTest < ActionMailer::TestCase # Test the body of the sent email contains what we expect it to assert_equal [user.email], email.to assert_equal "Welcome to My Awesome Site", email.subject - assert_match /

Welcome to example.com, #{user.name}<\/h1>/, email.encoded - assert_match /Welcome to example.com, #{user.name}/, email.encoded + assert_match(/

Welcome to example.com, #{user.name}<\/h1>/, email.encoded) + assert_match(/Welcome to example.com, #{user.name}/, email.encoded) end end diff --git a/railties/guides/source/testing.textile b/railties/guides/source/testing.textile index cc55d1f756..caa0d91a83 100644 --- a/railties/guides/source/testing.textile +++ b/railties/guides/source/testing.textile @@ -931,7 +931,7 @@ class UserControllerTest < ActionController::TestCase assert_equal "You have been invited by me@example.com", invite_email.subject assert_equal 'friend@example.com', invite_email.to[0] - assert_match /Hi friend@example.com/, invite_email.body + assert_match(/Hi friend@example.com/, invite_email.body) end end diff --git a/railties/lib/rails/generators/test_case.rb b/railties/lib/rails/generators/test_case.rb index ee85b70bb5..7319fb79f6 100644 --- a/railties/lib/rails/generators/test_case.rb +++ b/railties/lib/rails/generators/test_case.rb @@ -81,7 +81,7 @@ module Rails # # assert_file "app/controller/products_controller.rb" do |controller| # assert_instance_method :index, content do |index| - # assert_match /Product\.all/, index + # assert_match(/Product\.all/, index) # end # end # @@ -148,7 +148,7 @@ module Rails # # assert_migration "db/migrate/create_products.rb" do |migration| # assert_class_method :up, migration do |up| - # assert_match /create_table/, up + # assert_match(/create_table/, up) # end # end # @@ -161,7 +161,7 @@ module Rails # # assert_file "app/controller/products_controller.rb" do |controller| # assert_instance_method :index, content do |index| - # assert_match /Product\.all/, index + # assert_match(/Product\.all/, index) # end # end # -- cgit v1.2.3