aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorStephen St. Martin <kuprishuz@gmail.com>2010-01-23 12:48:11 -0500
committerStefan Penner <stefan.penner@gmail.com>2010-01-27 12:44:31 -0600
commit49e84a59439074fb7742b662db21e9638d41cfd0 (patch)
tree0adc89e5c14b5a5ba963b94d749e81f9ba074020 /actionpack
parent07299eb60d4ae625b3be2e919be4dbd737fb01be (diff)
downloadrails-49e84a59439074fb7742b662db21e9638d41cfd0.tar.gz
rails-49e84a59439074fb7742b662db21e9638d41cfd0.tar.bz2
rails-49e84a59439074fb7742b662db21e9638d41cfd0.zip
fix failing tests from fork/merge
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/ajax_helper.rb7
-rw-r--r--actionpack/test/template/ajax_helper_test.rb4
2 files changed, 6 insertions, 5 deletions
diff --git a/actionpack/lib/action_view/helpers/ajax_helper.rb b/actionpack/lib/action_view/helpers/ajax_helper.rb
index 7d97fb9698..f2ff424576 100644
--- a/actionpack/lib/action_view/helpers/ajax_helper.rb
+++ b/actionpack/lib/action_view/helpers/ajax_helper.rb
@@ -32,8 +32,9 @@ module ActionView
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 @@ module ActionView
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 @@ module ActionView
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
diff --git a/actionpack/test/template/ajax_helper_test.rb b/actionpack/test/template/ajax_helper_test.rb
index 86932d754f..95c839b96e 100644
--- a/actionpack/test/template/ajax_helper_test.rb
+++ b/actionpack/test/template/ajax_helper_test.rb
@@ -104,8 +104,8 @@ class ButtonToRemoteTest < AjaxTestCase
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