提交 7bf5aef9 编写于 作者: E Erik St. Martin 提交者: Stefan Penner

fixed current tests that were failing do to module location change, this is...

fixed current tests that were failing do to module location change, this is temporary to fix state of repo till all the new tests are complete
上级 255066b6
...@@ -574,6 +574,8 @@ def link_to_remote(name, url, options = nil) ...@@ -574,6 +574,8 @@ def link_to_remote(name, url, options = nil)
if !options && url.is_a?(Hash) && url.key?(:url) if !options && url.is_a?(Hash) && url.key?(:url)
url, options = url.delete(:url), url url, options = url.delete(:url), url
end end
options = {} if options.nil?
set_callbacks(options, options[:html] ||= {}) set_callbacks(options, options[:html] ||= {})
super super
......
require "abstract_unit" require "abstract_unit"
class AjaxTestCase < ActiveSupport::TestCase class AjaxTestCase < ActiveSupport::TestCase
include ActionView::Helpers::AjaxHelper
include ActionView::Helpers::TagHelper include ActionView::Helpers::TagHelper
def url_for(url) def url_for(url)
...@@ -34,6 +33,8 @@ def self.assert_callbacks_work(&blk) ...@@ -34,6 +33,8 @@ def self.assert_callbacks_work(&blk)
end end
class LinkToRemoteTest < AjaxTestCase class LinkToRemoteTest < AjaxTestCase
include ActionView::Helpers::AjaxHelperCompat
def link(options = {}) def link(options = {})
link_to_remote("Delete this post", "/blog/destroy/3", options) link_to_remote("Delete this post", "/blog/destroy/3", options)
end end
...@@ -79,7 +80,7 @@ def link(options = {}) ...@@ -79,7 +80,7 @@ def link(options = {})
end end
class LegacyLinkToRemoteTest < AjaxTestCase class LegacyLinkToRemoteTest < AjaxTestCase
include ActionView::Helpers::AjaxHelper::Rails2Compatibility include ActionView::Helpers::AjaxHelperCompat
def link(options) def link(options)
link_to_remote("Delete this post", "/blog/destroy/3", options) link_to_remote("Delete this post", "/blog/destroy/3", options)
...@@ -98,6 +99,8 @@ def link(options) ...@@ -98,6 +99,8 @@ def link(options)
end end
class ButtonToRemoteTest < AjaxTestCase class ButtonToRemoteTest < AjaxTestCase
include ActionView::Helpers::AjaxHelperCompat
def button(options, html = {}) def button(options, html = {})
button_to_remote("Remote outpost", options, html) button_to_remote("Remote outpost", options, html)
end end
...@@ -110,7 +113,7 @@ class StandardTest < ButtonToRemoteTest ...@@ -110,7 +113,7 @@ class StandardTest < ButtonToRemoteTest
end end
class LegacyButtonToRemoteTest < ButtonToRemoteTest class LegacyButtonToRemoteTest < ButtonToRemoteTest
include ActionView::Helpers::AjaxHelper::Rails2Compatibility include ActionView::Helpers::AjaxHelperCompat
assert_callbacks_work do |callback| assert_callbacks_work do |callback|
button(callback => "undoRequestCompleted(request)") button(callback => "undoRequestCompleted(request)")
...@@ -119,6 +122,8 @@ class LegacyButtonToRemoteTest < ButtonToRemoteTest ...@@ -119,6 +122,8 @@ class LegacyButtonToRemoteTest < ButtonToRemoteTest
end end
class ObserveFieldTest < AjaxTestCase class ObserveFieldTest < AjaxTestCase
include ActionView::Helpers::AjaxHelperCompat
def url_for(hash) def url_for(hash)
"/blog/update" "/blog/update"
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册