From c63a8d12f78798b507e1dfe05fb571477eeae69d Mon Sep 17 00:00:00 2001 From: paulo-felipe Date: Fri, 12 May 2023 22:30:07 -0300 Subject: [PATCH] refactor(spec/system/admin/subscriptions_spec.rb): issue #7483 Add context on third page and adding a product AND deleting the existing product AND adding a new product and click next button. --- spec/system/admin/subscriptions_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/system/admin/subscriptions_spec.rb b/spec/system/admin/subscriptions_spec.rb index 24f15dbdd5..65807162ad 100644 --- a/spec/system/admin/subscriptions_spec.rb +++ b/spec/system/admin/subscriptions_spec.rb @@ -390,6 +390,17 @@ describe 'Subscriptions' do expect(page).to have_selector 'td.total', text: "$23.25" end end + + context 'and click next button' do + before { click_button('Next') } + + it 'has current path as admin_subscriptions_path and counts by one subscription' do + expect{ + click_button('Create Subscription') + expect(page).to have_current_path admin_subscriptions_path + }.to change(Subscription, :count).by(1) + end + end end end end