Permalink
Browse files

fixed current tests that were failing do to module location change, t…

…his is temporary to fix state of repo till all the new tests are complete
  • Loading branch information...
erikstmartin authored and stefanpenner committed Jan 23, 2010
1 parent 255066b commit 7bf5aef907a90a9896c05ae3c6ed371a70aa6b8f
Showing with 10 additions and 3 deletions.
  1. +2 −0 actionpack/lib/action_view/helpers/ajax_helper.rb
  2. +8 −3 actionpack/test/template/ajax_helper_test.rb
@@ -574,6 +574,8 @@ def link_to_remote(name, url, options = nil)
if !options && url.is_a?(Hash) && url.key?(:url)
url, options = url.delete(:url), url
end
+ options = {} if options.nil?
+
set_callbacks(options, options[:html] ||= {})
super
@@ -1,7 +1,6 @@
require "abstract_unit"
class AjaxTestCase < ActiveSupport::TestCase
- include ActionView::Helpers::AjaxHelper
include ActionView::Helpers::TagHelper
def url_for(url)
@@ -34,6 +33,8 @@ def self.assert_callbacks_work(&blk)
end
class LinkToRemoteTest < AjaxTestCase
+ include ActionView::Helpers::AjaxHelperCompat
+
def link(options = {})
link_to_remote("Delete this post", "/blog/destroy/3", options)
end
@@ -79,7 +80,7 @@ def link(options = {})
end
class LegacyLinkToRemoteTest < AjaxTestCase
- include ActionView::Helpers::AjaxHelper::Rails2Compatibility
+ include ActionView::Helpers::AjaxHelperCompat
def link(options)
link_to_remote("Delete this post", "/blog/destroy/3", options)
@@ -98,6 +99,8 @@ def link(options)
end
class ButtonToRemoteTest < AjaxTestCase
+ include ActionView::Helpers::AjaxHelperCompat
+
def button(options, html = {})
button_to_remote("Remote outpost", options, html)
end
@@ -110,7 +113,7 @@ class StandardTest < ButtonToRemoteTest
end
class LegacyButtonToRemoteTest < ButtonToRemoteTest
- include ActionView::Helpers::AjaxHelper::Rails2Compatibility
+ include ActionView::Helpers::AjaxHelperCompat
assert_callbacks_work do |callback|
button(callback => "undoRequestCompleted(request)")
@@ -119,6 +122,8 @@ class LegacyButtonToRemoteTest < ButtonToRemoteTest
end
class ObserveFieldTest < AjaxTestCase
+ include ActionView::Helpers::AjaxHelperCompat
+
def url_for(hash)
"/blog/update"
end

0 comments on commit 7bf5aef

Please sign in to comment.