small medium large xlarge

Generic-user-small
21 Oct 2016, 18:39
Craig (1 post)

How do I interpret command line errors. I find that sometimes the error messages are a bit cryptic because they might not point to exactly what the problem is. In other words, do you guys have any tips on how I can get good at fixing errors?

The example below is a problem I have. I double checked the code in the book and it seems to be exactly the same. Plus I checked the source code as well. Any help would be great.

thanks in advance

Craig

My error message in my command line:

depot/test/controllers/line_items_controller_test.rb:61:in <class:LineItemsControllerTest>': undefined method assert_response’ for LineItemsControllerTest:Class (NoMethodError)

part of my code in test/controllers/line_items_controller_test:

test “should update line_item” do patch line_item_url(@line_item), params: { line_item: { product_id: @line_item.product_id } } assert_redirected_to line_item_url(@line_item) end

test “should destroy line_item” do assert_difference(‘LineItem.count’, -1) do delete line_item_url(@line_item) end

assert_redirected_to line_items_url   end

test “should create line_item via ajax” do assert_difference(‘LineItem.count’) do post line_items_url, params: { product_id: products(:ruby).id }, xhr: true end end

assert_response :success assert_select_jquery :html, ‘#cart’ do assert_select ‘tr#current_item td’, /Programming Ruby 1.9/ end end >

You must be logged in to comment