mirror of
https://github.com/github/rails.git
synced 2026-01-31 01:08:19 -05:00
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6967 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Improve Action View test coverage. #7241, #7243, #7244 [Rich Collins]
|
||||
|
||||
* Resources: url_for([parent, child]) generates /parents/1/children/2 for the nested resource. Likewise with the other simply helpful methods like form_for and link_to. #6432 [mhw, Jonathan Vaught, lotswholetime]
|
||||
|
||||
* Assume html format when rendering partials in RJS. #8076 [Rick]
|
||||
|
||||
@@ -46,6 +46,11 @@ class JavaScriptHelperTest < Test::Unit::TestCase
|
||||
assert_dom_equal %(<a href="#" class="updater" onclick="Element.update("header", "\\074h1\\076Greetings\\074/h1\\076");; return false;">Greet me!</a>), html
|
||||
end
|
||||
|
||||
def test_link_to_function_with_href
|
||||
assert_dom_equal %(<a href="http://example.com/" onclick="alert('Hello world!'); return false;">Greeting</a>),
|
||||
link_to_function("Greeting", "alert('Hello world!')", :href => 'http://example.com/')
|
||||
end
|
||||
|
||||
def test_button_to_function
|
||||
assert_dom_equal %(<input type="button" onclick="alert('Hello world!');" value="Greeting" />),
|
||||
button_to_function("Greeting", "alert('Hello world!')")
|
||||
|
||||
@@ -210,7 +210,12 @@ class PrototypeHelperTest < Test::Unit::TestCase
|
||||
assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nnew Form.Observer('cart', 2, function(element, value) {alert('Form changed')})\n//]]>\n</script>),
|
||||
observe_form("cart", :frequency => 2, :function => "alert('Form changed')")
|
||||
end
|
||||
|
||||
|
||||
def test_observe_field_without_frequency
|
||||
assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nnew Form.Element.EventObserver('glass', function(element, value) {new Ajax.Request('http://www.example.com/', {asynchronous:true, evalScripts:true, parameters:value})})\n//]]>\n</script>),
|
||||
observe_field("glass")
|
||||
end
|
||||
|
||||
def test_update_page
|
||||
block = Proc.new { |page| page.replace_html('foo', 'bar') }
|
||||
assert_equal create_generator(&block).to_s, update_page(&block)
|
||||
|
||||
Reference in New Issue
Block a user