From 03aade4072575eca3a668c8485593c85ff81acb1 Mon Sep 17 00:00:00 2001 From: paulo-felipe Date: Wed, 17 May 2023 21:48:25 -0300 Subject: [PATCH] refactor(spec/system/admin/subscriptions_spec.rb): issue #7483 Add context when click Create Subscription button on third page after click next button previously on second page. It has selector for price, input for quantity and selector for total price. --- spec/system/admin/subscriptions_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/system/admin/subscriptions_spec.rb b/spec/system/admin/subscriptions_spec.rb index c90567c6dd..3b4181c1e6 100644 --- a/spec/system/admin/subscriptions_spec.rb +++ b/spec/system/admin/subscriptions_spec.rb @@ -410,6 +410,20 @@ describe 'Subscriptions' do select2_select shop.name, from: "shop_id" expect(page).to have_selector "td.items.panel-toggle" end + + it 'has selector for price, input for quantity and selector for total price' do + click_button('Create Subscription') + select2_select shop.name, from: "shop_id" + first("td.items.panel-toggle").click + + within 'table#subscription-line-items tr.item', match: :first do + expect(page).to have_selector '.description', + text: "#{shop_product.name} - #{shop_variant.full_name}" + expect(page).to have_selector 'td.price', text: "$7.75" + expect(page).to have_input 'quantity', with: "3" + expect(page).to have_selector 'td.total', text: "$23.25" + end + end end end end