Sha256: 532cc73343a30cf6c9235ec17e2509856842406290b8a8583d0bec4d2f4cf281
Contents?: true
Size: 912 Bytes
Versions: 3
Compression:
Stored size: 912 Bytes
Contents
module ShoppingCart RSpec.describe 'Coupon' do before do login_as user, scope: :user visit shopping_cart.root_path end let(:user) { create :user_with_orders } context 'when exists' do before do within '.edit_order' do fill_in 'order[coupon][code]', with: coupon.code click_button I18n.t('cart.update_order') end end let(:coupon) { create :coupon } it 'should apply coupon' do expect(page).to have_content I18n.t('cart.discount') end end context 'when not exists' do before do within '.edit_order' do fill_in 'order[coupon][code]', with: 'lalala' click_button I18n.t('cart.update_order') end it 'should say that coupon does not exist' do expect(page).not_to have_content I18n.t('cart.discount') end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems