correctly greping for depreciated ERb block helpers

This commit is contained in:
Zac Williams 2010-08-20 06:35:00 +08:00 committed by Jeremy McAnally
parent 22ce8cab63
commit 3015100b37
1 changed files with 7 additions and 0 deletions

View File

@ -246,6 +246,13 @@ class ApplicationCheckerTest < ActiveSupport::TestCase
assert @checker.alerts.has_key?("Deprecated ERb helper calls") assert @checker.alerts.has_key?("Deprecated ERb helper calls")
end end
def test_check_old_helpers_lets_regular_blocks_pass
make_file("app/views/users/", "another_test.html.erb", "<b>blah blah blah</b><% @some_items.each do |item| %> <label>doo dah</label> <%= item %> <% end %>")
@checker.check_old_helpers
assert_equal @checker.alerts.has_key?("Deprecated ERb helper calls"), false
end
def test_check_old_ajax_helpers 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 } %>") 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 @checker.check_old_ajax_helpers