refactor(spec/system/admin/subscriptions_spec.rb): issue #7483

Add context on third page and adding a product.
This commit is contained in:
paulo-felipe
2023-05-11 21:14:50 -03:00
parent f05e2618be
commit b0623ab4de

View File

@@ -317,7 +317,6 @@ describe 'Subscriptions' do
expect(page).to have_input "ship_address_address1", with: '7 Tempany Lane'
end
end
end
end
end
@@ -345,6 +344,20 @@ describe 'Subscriptions' do
expect(page).to have_content 'Please add at least one product'
end
end
context 'and adding a product' do
before { add_variant_to_subscription test_variant, 2 }
it 'has description, price estimates, quantity and total' do
within 'table#subscription-line-items tr.item', match: :first do
expect(page).to have_selector '.description',
text: "#{test_product.name} - #{test_variant.full_name}"
expect(page).to have_selector 'td.price', text: "$13.75"
expect(page).to have_input 'quantity', with: "2"
expect(page).to have_selector 'td.total', text: "$27.50"
end
end
end
end
it "passes the smoke test" do