small medium large xlarge

03 Aug 2016, 11:07
ShangYo Chen (3 posts)

From the book (pdf) p.165, the code snippet in test/controllers/line_items_controller_test.rb:

assert_select_jquery :html, '#cart' do
   assert_select 'tr#current_item td', /Programming Ruby 1.9/


No JQuery call matches [:html, "#cart"]

According to what I’ve googled, it has something to do with jquery-rails. However, the issue seems exists for a long time. (

I wonder why it’s not fixed.

08 Aug 2016, 15:10
Sam Ruby (633 posts)

The test passes for me:

Care to provide a link to what you saw from on the web?

16 Aug 2016, 09:22
ShangYo Chen (3 posts)

My problem solved in a mysterious way:

I found out that I forgot to add ; for jQuery statement in app/views/line_items/create.js.erb.

When I add them back, the test passes.

Wonder why this would happen. I thought ; in js is not mandatory.

You must be logged in to comment