Permalink
Browse files

fix failing tests from fork/merge

  • Loading branch information...
1 parent 07299eb commit 49e84a59439074fb7742b662db21e9638d41cfd0 @stevestmartin stevestmartin committed with stefanpenner Jan 23, 2010
@@ -32,8 +32,9 @@ def link_to_remote(name, url, options = {})
end
def button_to_remote(name, options = {}, html_options = {})
- attributes = html_options.merge!(:type => "button")
+ attributes = html_options.merge!(:type => "button", :value => name)
attributes.merge!(extract_remote_attributes!(options))
+ attributes.merge!(extract_request_attributes!(options))
tag(:input, attributes)
end
@@ -59,7 +60,7 @@ def periodically_call_remote(options = {})
def observe_field(name, options = {})
options[:observed] = name
attributes = extract_observer_attributes!(options)
- attributes["data-js-type"] = "field_observer"
+ attributes["data-observe"] = true
script_decorator(attributes)
end
@@ -85,7 +86,7 @@ def extract_remote_attributes!(options)
attributes.merge!(extract_update_attributes!(options))
attributes.merge!(extract_request_attributes!(options))
- attributes["data-js-type"] = options.delete(:js_type) || "remote"
+ attributes["data-remote"] = true
attributes
end
@@ -104,8 +104,8 @@ def button(options, html = {})
class StandardTest < ButtonToRemoteTest
test "basic" do
- assert_html button({:url => {:action => "whatnot"}}, {:class => "fine"}),
- %w(input class="fine" type="button" value="Remote outpost" data-url="/url/hash")
+ expected = %{<input class="fine" data-remote="true" data-url="/url/hash" type="button" value="Remote outpost" />}
+ assert_equal expected, button({:url => "/url/hash"}, {:class => "fine"})
end
end

0 comments on commit 49e84a5

Please sign in to comment.