提交 dce0da77 编写于 作者: F Frederick Cheung

Fix assert_select_rjs not checking id for inserts [#540 state:resolved]

上级 d7b6e48c
......@@ -402,6 +402,7 @@ def assert_select_rjs(*args, &block)
if rjs_type
if rjs_type == :insert
position = args.shift
id = args.shift
insertion = "insert_#{position}".to_sym
raise ArgumentError, "Unknown RJS insertion type #{position}" unless RJS_STATEMENTS[insertion]
statement = "(#{RJS_STATEMENTS[insertion]})"
......
......@@ -248,6 +248,14 @@ def test_assert_select_from_rjs_with_multiple_results
end
end
def test_assert_select_rjs_for_positioned_insert_should_fail_when_mixing_arguments
render_rjs do |page|
page.insert_html :top, "test1", "<div id=\"1\">foo</div>"
page.insert_html :bottom, "test2", "<div id=\"2\">foo</div>"
end
assert_raises(Assertion) {assert_select_rjs :insert, :top, "test2"}
end
#
# Test css_select.
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册