Agile Web Development with Rails, Edition 4

Agile Web Development with Rails, Edition 4

11.6 Iteration F6: Testing AJAX changes 11.4 Iteration F4: Hide an Empty Cart

11.5 Iteration F5: Making Images Clickable

Review our current storefront markup

edit app/views/store/index.html.erb
<% if notice %>
<p id="notice"><%= notice %></p>
<% end %>
 
<h1>Your Pragmatic Catalog</h1>
 
<% @products.each do |product| %>
  <div class="entry">
    <%= image_tag(product.image_url) %>
    <h3><%= product.title %></h3>
    <%= sanitize(product.description) %>
    <div class="price_line">
      <span class="price"><%= number_to_currency(product.price) %></span>
      <%= button_to 'Add to Cart', line_items_path(product_id: product),
        remote: true %>
    </div>
  </div>
<% end %>

Associate image clicks with submit button clicks

edit app/assets/javascripts/store.js.coffee
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
 
$ -> 
  $('.store .entry > img').click ->
    $(this).parent().find(':submit').click()

The page looks no different

get /
Your Cart
CoffeeScript $36.00
Total $36.00

Your Pragmatic Catalog

Cs

CoffeeScript

CoffeeScript is JavaScript done right. It provides all of JavaScript's functionality wrapped in a cleaner, more succinct syntax. In the first book on this exciting new language, CoffeeScript guru Trevor Burnham shows you how to hold onto all the power and flexibility of JavaScript while writing clearer, cleaner, and safer code.

$36.00
Ruby

Programming Ruby 1.9

Ruby is the fastest growing and most exciting dynamic language out there. If you need to get working programs delivered fast, you should add Ruby to your toolbox.

$49.95
Rtp

Rails Test Prescriptions

Rails Test Prescriptions is a comprehensive guide to testing Rails applications, covering Test-Driven Development from both a theoretical perspective (why to test) and from a practical perspective (how to test effectively). It covers the core Rails testing tools and procedures for Rails 2 and Rails 3, and introduces popular add-ons, including Cucumber, Shoulda, Machinist, Mocha, and Rcov.

$34.95

Run tests... oops.

rake test
Loaded suite /home/rubys/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader
Started
.......
Finished in 0.642826 seconds.
 
7 tests, 28 assertions, 0 failures, 0 errors, 0 skips
 
Test run options: --seed 5476
Loaded suite /home/rubys/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader
Started
...E...F.EEEE....EEEE..
Finished in 1.364722 seconds.
 
  1) Error:
test_should_get_index(CartsControllerTest):
ActionView::Template::Error: undefined method `line_items' for nil:NilClass
    /home/rubys/git/rails/activesupport/lib/active_support/whiny_nil.rb:48:in `method_missing'
    /home/rubys/git/awdwr/edition4/work-192/depot/app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb___437608112366396899_32061040'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:143:in `block in render'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `block in instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `instrument'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:141:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:51:in `render_with_layout'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:37:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:12:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:36:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:17:in `render'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:120:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/streaming.rb:225:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:114:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:30:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:43:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:99:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:16:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
    /home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
 
  2) Failure:
test_should_create_line_item(LineItemsControllerTest) [/home/rubys/git/awdwr/edition4/work-192/depot/test/functional/line_items_controller_test.rb:28]:
Expected response to be a redirect to <http://test.host/carts/980190963> but was a redirect to <http://test.host/>
 
  3) Error:
test_should_get_edit(LineItemsControllerTest):
ActionView::Template::Error: undefined method `line_items' for nil:NilClass
    /home/rubys/git/rails/activesupport/lib/active_support/whiny_nil.rb:48:in `method_missing'
    /home/rubys/git/awdwr/edition4/work-192/depot/app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb___437608112366396899_32061040'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:143:in `block in render'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `block in instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `instrument'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:141:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:51:in `render_with_layout'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:37:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:12:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:36:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:17:in `render'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:120:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/streaming.rb:225:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:114:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:30:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:43:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:99:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:16:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
    /home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
 
  4) Error:
test_should_get_index(LineItemsControllerTest):
ActionView::Template::Error: undefined method `line_items' for nil:NilClass
    /home/rubys/git/rails/activesupport/lib/active_support/whiny_nil.rb:48:in `method_missing'
    /home/rubys/git/awdwr/edition4/work-192/depot/app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb___437608112366396899_32061040'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:143:in `block in render'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `block in instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `instrument'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:141:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:51:in `render_with_layout'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:37:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:12:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:36:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:17:in `render'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:120:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/streaming.rb:225:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:114:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:30:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:43:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:99:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:16:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
    /home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
 
  5) Error:
test_should_get_new(LineItemsControllerTest):
ActionView::Template::Error: undefined method `line_items' for nil:NilClass
    /home/rubys/git/rails/activesupport/lib/active_support/whiny_nil.rb:48:in `method_missing'
    /home/rubys/git/awdwr/edition4/work-192/depot/app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb___437608112366396899_32061040'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:143:in `block in render'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `block in instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `instrument'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:141:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:51:in `render_with_layout'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:37:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:12:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:36:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:17:in `render'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:120:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/streaming.rb:225:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:114:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:30:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:43:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:99:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:16:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
    /home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
 
  6) Error:
test_should_show_line_item(LineItemsControllerTest):
ActionView::Template::Error: undefined method `line_items' for nil:NilClass
    /home/rubys/git/rails/activesupport/lib/active_support/whiny_nil.rb:48:in `method_missing'
    /home/rubys/git/awdwr/edition4/work-192/depot/app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb___437608112366396899_32061040'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:143:in `block in render'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `block in instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `instrument'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:141:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:51:in `render_with_layout'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:37:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:12:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:36:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:17:in `render'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:120:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/streaming.rb:225:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:114:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:30:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:43:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:99:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:16:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
    /home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
 
  7) Error:
test_should_get_edit(ProductsControllerTest):
ActionView::Template::Error: undefined method `line_items' for nil:NilClass
    /home/rubys/git/rails/activesupport/lib/active_support/whiny_nil.rb:48:in `method_missing'
    /home/rubys/git/awdwr/edition4/work-192/depot/app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb___437608112366396899_32061040'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:143:in `block in render'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `block in instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `instrument'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:141:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:51:in `render_with_layout'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:37:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:12:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:36:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:17:in `render'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:120:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/streaming.rb:225:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:114:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:30:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:43:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:99:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:16:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
    /home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
 
  8) Error:
test_should_get_index(ProductsControllerTest):
ActionView::Template::Error: undefined method `line_items' for nil:NilClass
    /home/rubys/git/rails/activesupport/lib/active_support/whiny_nil.rb:48:in `method_missing'
    /home/rubys/git/awdwr/edition4/work-192/depot/app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb___437608112366396899_32061040'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:143:in `block in render'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `block in instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `instrument'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:141:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:51:in `render_with_layout'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:37:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:12:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:36:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:17:in `render'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:120:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/streaming.rb:225:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:114:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:30:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:43:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:99:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:16:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
    /home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
 
  9) Error:
test_should_get_new(ProductsControllerTest):
ActionView::Template::Error: undefined method `line_items' for nil:NilClass
    /home/rubys/git/rails/activesupport/lib/active_support/whiny_nil.rb:48:in `method_missing'
    /home/rubys/git/awdwr/edition4/work-192/depot/app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb___437608112366396899_32061040'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:143:in `block in render'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `block in instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `instrument'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:141:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:51:in `render_with_layout'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:37:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:12:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:36:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:17:in `render'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:120:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/streaming.rb:225:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:114:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:30:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:43:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:99:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:16:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
    /home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
 
 10) Error:
test_should_show_product(ProductsControllerTest):
ActionView::Template::Error: undefined method `line_items' for nil:NilClass
    /home/rubys/git/rails/activesupport/lib/active_support/whiny_nil.rb:48:in `method_missing'
    /home/rubys/git/awdwr/edition4/work-192/depot/app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb___437608112366396899_32061040'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:143:in `block in render'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `block in instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:53:in `instrument'
    /home/rubys/git/rails/actionpack/lib/action_view/template.rb:141:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:51:in `render_with_layout'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:37:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/template_renderer.rb:12:in `render'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:36:in `render_template'
    /home/rubys/git/rails/actionpack/lib/action_view/renderer/renderer.rb:17:in `render'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:120:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/streaming.rb:225:in `_render_template'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:114:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:30:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:43:in `render_to_body'
    /home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:99:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:16:in `render'
    /home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
    /home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
 
23 tests, 26 assertions, 1 failures, 9 errors, 0 skips
 
Test run options: --seed 63164
Errors running test:functionals! #<RuntimeError: Command failed with status (1): [/home/rubys/.rvm/rubies/ruby-1.9.2-p290/bi...]>

11.6 Iteration F6: Testing AJAX changes 11.4 Iteration F4: Hide an Empty Cart