Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8750 (new defect)

Opened 2 years ago

[PATCH] Add assert_select_rjs replace/replace_html calls for chained replace/replace_html calls

Reported by: zdennis Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

This patch adds assert_select_rjs support for replace/replace_html when a page is rendered with chained selector calls. Before you COULD NOT make the following assert_select calls given the page[id] calls:

    render_rjs do |page|
      page["test1"].replace "<div id=\"1\">foo</div>"
      page["test2"].replace_html "<div id=\"2\">foo</div>"
    end

    # Replace.
    assert_select_rjs :replace
    assert_select_rjs :replace, "test1"

    # Replace HTML.
    assert_select_rjs :replace_html
    assert_select_rjs :replace_html, "test2"

You can work around this by using :chained_replace and :chained_replace_html selector calls but this is unintuitive and pointless for the developer. "replace" and "replace_html" should work regardless of if the developer calls "page[id]" or "page id".

Attachments

add_assert_select_rjs_calls_for_chained_replace_page_calls.diff (3.4 kB) - added by zdennis on 06/26/07 03:23:10.
assert_select_rjs patch taken from root of actionpack/

Change History

06/26/07 03:23:10 changed by zdennis

  • attachment add_assert_select_rjs_calls_for_chained_replace_page_calls.diff added.

assert_select_rjs patch taken from root of actionpack/