check_old_ajax_helpers correctly prints nothing if no problems were found.

This commit is contained in:
Pat George 2010-06-05 05:25:51 +08:00 committed by Jeremy McAnally
parent f44e5c7edf
commit 865e3f7d2a
2 changed files with 127 additions and 114 deletions

View File

@ -245,7 +245,7 @@ module Rails
files += inner_files unless inner_files.nil?
end
if files
unless files.empty?
alert(
"Deprecated AJAX helper calls",
"AJAX javascript helpers have been switched to be unobtrusive and use :remote => true instead of having a seperate function to handle remote requests.",

View File

@ -190,6 +190,19 @@ class ApplicationCheckerTest < ActiveSupport::TestCase
assert @checker.alerts.has_key?("Deprecated ERb helper calls")
end
def test_check_old_ajax_helpers
make_file("app/views/sections", "section.js", "<%= link_to_remote 'section-', :update => 'sections', :url => {:action => :destroy, :controller => 'sections', :id => @section.id } %>")
@checker.check_old_ajax_helpers
assert @checker.alerts.has_key?("Deprecated AJAX helper calls")
end
def test_check_old_ajax_helpers_empty
@checker.check_old_ajax_helpers
assert ! @checker.alerts.has_key?("Deprecated AJAX helper calls")
end
def teardown
clear_files