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.
This commit is contained in:
paulo-felipe
2023-05-12 22:30:07 -03:00
parent 5a5aa4c067
commit c63a8d12f7

View File

@@ -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