From 63353ebace437410161d1456c3668537372bc525 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Fri, 17 Apr 2015 16:49:14 +1000 Subject: [PATCH] Don't try and delete the only variant, that will never work! --- spec/features/admin/variants_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/features/admin/variants_spec.rb b/spec/features/admin/variants_spec.rb index c947872949..910f299386 100644 --- a/spec/features/admin/variants_spec.rb +++ b/spec/features/admin/variants_spec.rb @@ -60,12 +60,14 @@ feature %q{ it "soft-deletes variants", js: true do p = create(:simple_product) - v = p.variants.first + v = create(:variant, product: p) login_to_admin_section visit spree.admin_product_variants_path p - page.find('a.delete-resource').click + within "tr#spree_variant_#{v.id}" do + page.find('a.delete-resource').click + end page.should_not have_content v.options_text v.reload