mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
fix duplidate data-submit attribute, submit_to_remote should test url
This commit is contained in:
committed by
Stefan Penner
parent
2204215b43
commit
8b7cd5ae7e
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user