fix duplidate data-submit attribute, submit_to_remote should test url

This commit is contained in:
Stephen St. Martin
2010-01-25 22:45:44 -05:00
committed by Stefan Penner
parent 2204215b43
commit 8b7cd5ae7e
2 changed files with 3 additions and 3 deletions

View File

@@ -361,7 +361,7 @@ module ActionView
attributes = extract_remote_attributes!(options)
attributes.merge!(html_options)
attributes["data-submit"] = true
attributes["data-remote-submit"] = true
attributes.delete("data-remote")
tag(:input, attributes)

View File

@@ -267,8 +267,8 @@ class AjaxHelperTest < AjaxHelperBaseTest
end
test "submit_to_remote" do
assert_dom_equal %(<input name=\"More beer!\" type=\"button\" value=\"1000000\" data-url=\"http://www.example.com/\" data-submit=\"true\" data-update-success=\"empty_bottle\" />),
submit_to_remote("More beer!", 1_000_000, :update => "empty_bottle")
assert_dom_equal %(<input name=\"More beer!\" type=\"button\" value=\"1000000\" data-url=\"http://www.example.com/empty_bottle\" data-remote-submit=\"true\" data-update-success=\"empty_bottle\" />),
submit_to_remote("More beer!", 1_000_000, :url => { :action => 'empty_bottle' }, :update => "empty_bottle")
end
test "observe_field" do