spec/features/admin/orders/payments_spec.rb in solidus_backend-2.4.2 vs spec/features/admin/orders/payments_spec.rb in solidus_backend-2.5.0.beta1

- old
+ new

@@ -60,25 +60,23 @@ payment.source.update!(address: create(:address, address1: 'my cc address')) visit spree.admin_order_payment_path(order, payment) expect(page).to have_content 'my cc address' end - it 'lists and create payments for an order', js: true do + it 'lists, updates and creates payments for an order', js: true do within_row(1) do - expect(column_text(3)).to eq('$150.00') - expect(column_text(4)).to eq('Credit Card') - expect(column_text(6)).to eq('Checkout') + expect(column_text(3)).to eq('Credit Card') + expect(column_text(5)).to eq('Checkout') + expect(column_text(6)).to have_content('$150.00') end click_icon :void expect(page).to have_css('#payment_status', text: 'Balance due') expect(page).to have_content('Payment Updated') within_row(1) do - expect(column_text(3)).to eq('$150.00') - expect(column_text(4)).to eq('Credit Card') - expect(column_text(6)).to eq('Void') + expect(column_text(5)).to eq('Void') end click_on 'New Payment' expect(page).to have_content('New Payment') click_button 'Update' @@ -133,11 +131,10 @@ click_icon(:edit) fill_in('amount', with: 'invalid') click_icon(:save) end expect(page).to have_selector('.flash.error', text: 'Invalid resource. Please fix errors and try again.') - expect(page).to have_field('amount', with: 'invalid') expect(payment.reload.amount).to eq(150.00) end end context 'payment is completed', js: true do @@ -226,11 +223,11 @@ payment_method: payment_method ) end before do - payment_method.destroy + payment_method.discard visit spree.admin_order_payments_path(order.reload) end it "can list and view the payment" do expect(page).to have_content(payment.number) @@ -285,9 +282,9 @@ fill_in "Card Number", with: "4111 1111 1111 1111" fill_in "Name", with: "Test User" fill_in "Expiration", with: "09 / #{Time.current.year + 1}" fill_in "Card Code", with: "007" click_button "Continue" - expect(page).to have_content Spree.t(:insufficient_stock_for_order) + expect(page).to have_content I18n.t('spree.insufficient_stock_for_order') end end end