check_old_ajax_helpers correctly prints nothing if no problems were found.
This commit is contained in:
parent
f44e5c7edf
commit
865e3f7d2a
@ -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.",
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user