diff --git a/app/views/admin/order_cycles/index.html.haml b/app/views/admin/order_cycles/index.html.haml index bb2feb83c6..26316a7af6 100644 --- a/app/views/admin/order_cycles/index.html.haml +++ b/app/views/admin/order_cycles/index.html.haml @@ -43,9 +43,14 @@ - order_cycle.distributors.each do |d| = d.name %br/ + %td.products - - order_cycle.variants.each do |v| - = image_tag(v.images.first.attachment.url(:mini)) if v.images.present? + - variant_images = capture do + - order_cycle.variants.each do |v| + = image_tag(v.images.first.attachment.url(:mini)) if v.images.present? + %br/ + %span.with-tip{'data-powertip' => variant_images}= "#{order_cycle.variants.count} variants" + %td.actions = link_to '', main_app.clone_admin_order_cycle_path(order_cycle), class: 'clone-order-cycle icon-copy no-text' = f.submit 'Update' diff --git a/spec/features/admin/order_cycles_spec.rb b/spec/features/admin/order_cycles_spec.rb index c2533b8704..ac111b70b2 100644 --- a/spec/features/admin/order_cycles_spec.rb +++ b/spec/features/admin/order_cycles_spec.rb @@ -36,8 +36,8 @@ feature %q{ oc.suppliers.each { |s| page.should have_content s.name } oc.distributors.each { |d| page.should have_content d.name } - # And I should see a thumbnail image for each product - all('td.products img').count.should == 2 + # And I should see the number of variants + page.should have_selector 'td.products', text: '2 variants' end scenario "creating an order cycle", js: true do