mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
periodically_call_remote does not need data-observe=true
This commit is contained in:
committed by
Stefan Penner
parent
6a8da2053e
commit
0215466832
@@ -402,6 +402,9 @@ module ActionView
|
||||
attributes = extract_observer_attributes!(options)
|
||||
attributes["data-periodical"] = true
|
||||
|
||||
# periodically_call_remote does not need data-observe=true
|
||||
attributes.delete('data-observe')
|
||||
|
||||
script_decorator(attributes)
|
||||
end
|
||||
|
||||
|
||||
@@ -160,13 +160,13 @@ class AjaxHelperTest < AjaxHelperBaseTest
|
||||
end
|
||||
|
||||
test "periodically_call_remote" do
|
||||
assert_dom_equal %(<script data-url=\"http://www.example.com/mehr_bier\" data-observe=\"true\" data-update-success=\"schremser_bier\" type=\"application/json\" data-periodical=\"true\"></script>),
|
||||
assert_dom_equal %(<script data-url=\"http://www.example.com/mehr_bier\" data-update-success=\"schremser_bier\" type=\"application/json\" data-periodical=\"true\"></script>),
|
||||
periodically_call_remote(:update => "schremser_bier", :url => { :action => "mehr_bier" })
|
||||
end
|
||||
|
||||
test "periodically_call_remote_with_frequency" do
|
||||
assert_dom_equal(
|
||||
"<script data-periodical=\"true\" data-url=\"http://www.example.com/\" data-observe=\"true\" type=\"application/json\" data-frequency=\"2\"></script>",
|
||||
"<script data-periodical=\"true\" data-url=\"http://www.example.com/\" type=\"application/json\" data-frequency=\"2\"></script>",
|
||||
periodically_call_remote(:frequency => 2)
|
||||
)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user