public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Fix assert_select_rjs not checking id for inserts [#540 state:resolved]
fcheung (author)
Thu Dec 25 03:11:00 -0800 2008
commit  dce0da77e7ef602f7420f43c0d1aba5a99a00bdb
tree    d917bf9cd17da1575ea6ad3c97c8311ddc3ad2a6
parent  d7b6e48c70076a7760e22c381e48834ecddfa6e3
...
402
403
404
 
405
406
407
...
402
403
404
405
406
407
408
0
@@ -402,6 +402,7 @@ module ActionController
0
         if rjs_type
0
           if rjs_type == :insert
0
             position  = args.shift
0
+            id = args.shift
0
             insertion = "insert_#{position}".to_sym
0
             raise ArgumentError, "Unknown RJS insertion type #{position}" unless RJS_STATEMENTS[insertion]
0
             statement = "(#{RJS_STATEMENTS[insertion]})"
...
248
249
250
 
 
 
 
 
 
 
 
251
252
253
...
248
249
250
251
252
253
254
255
256
257
258
259
260
261
0
@@ -248,6 +248,14 @@ class AssertSelectTest < ActionController::TestCase
0
     end
0
   end
0
 
0
+  def test_assert_select_rjs_for_positioned_insert_should_fail_when_mixing_arguments
0
+    render_rjs do |page|
0
+      page.insert_html :top, "test1", "<div id=\"1\">foo</div>"
0
+      page.insert_html :bottom, "test2", "<div id=\"2\">foo</div>"
0
+    end
0
+    assert_raises(Assertion) {assert_select_rjs :insert, :top, "test2"}
0
+  end
0
+
0
   #
0
   # Test css_select.
0
   #

Comments