Permalink
Browse files

Merge pull request #17 from boone/send_on_to_sent_on

'send_on' should be 'sent_on'
  • Loading branch information...
2 parents bb54bbd + 407ec60 commit decddca8ddfe04eea614f27875816b8b9581c604 @radar radar committed Jan 19, 2012
Showing with 12 additions and 5 deletions.
  1. +5 −5 lib/application_checker.rb
  2. +7 −0 test/application_checker_test.rb
View
@@ -343,16 +343,16 @@ def check_old_session_setting
end
end
- #Check for old ActionMailer :send_on attributes
- def check_old_action_mailer_send_on_setting
+ #Check for old ActionMailer :sent_on attributes
+ def check_old_action_mailer_sent_on_setting
files = []
- lines = grep_for("@sent_on", "app/*")
+ lines = grep_for("sent_on", "app/*")
files += extract_filenames(lines) || []
unless files.empty?
alert(
- "Deprecated ActionMailer attribute :send_on",
- "This is deprecated without replace.",
+ "Deprecated ActionMailer attribute :sent_on",
+ "Using the new mailer API, you can specify :date to the mail method.",
"http://stackoverflow.com/questions/7367185/weird-error-when-delivering-mail-undefined-method-index-for-2011-09-09-2215",
files
)
@@ -311,6 +311,13 @@ def test_check_old_ajax_helpers_empty
assert ! @checker.alerts.has_key?("Deprecated AJAX helper calls")
end
+ def test_check_old_action_mailer_sent_on_setting
+ make_file("app/models", "mailer.rb", "sent_on Time.now")
+ @checker.check_old_action_mailer_sent_on_setting
+
+ assert @checker.alerts.has_key?("Deprecated ActionMailer attribute :sent_on")
+ end
+
def teardown
clear_files

0 comments on commit decddca

Please sign in to comment.