Sha256: 647c7c2f9ffa8142c0277f03000a0079a1c44e56e51a46898f4079ef7aadd95c

Contents?: true

Size: 1.4 KB

Versions: 2

Compression:

Stored size: 1.4 KB

Contents

require 'spec_helper'

describe 'Orders', type: :feature, js: true do
  stub_authorization!
  
  context "admin creating and update a new payment method" do
    it 'should be able to create a new payment method for Ebs and update preferences' do
      visit spree.admin_path
      click_link "Settings"

      click_link "Payment Methods"
      click_link "admin_new_payment_methods_link"

      fill_in "payment_method_name", :with => "Credit Card / Debit Card / Net Banking"
      fill_in "payment_method_description", :with => "Testing Credit Card / Debit Card / Net Banking Payment using EBS"

      select "PaymentMethod::Ebsin", :from => "gtwy-type"

      click_button "Create"
      expect(page).to have_content("successfully created!")

      expect(find_field('payment_method_ebsin_preferred_url').value).to eq("https://secure.ebs.in/pg/ma/payment/request")

      fill_in 'payment_method_ebsin_preferred_account_id', :with => "5880"
      fill_in 'payment_method_ebsin_preferred_secret_key', :with => "ebskey"
      fill_in 'payment_method_ebsin_preferred_mode', :with => "TEST"
      fill_in 'payment_method_ebsin_preferred_currency_code', :with => "INR"
      select 'Both', :from => "payment_method_display_on"

      click_button "Update"
      expect(page).to have_content("successfully updated!")

      expect(find_field("payment_method_name").value).to eq("Credit Card / Debit Card / Net Banking")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_ebsin-3.1.1.2 spec/features/admin_payment_method_spec.rb
spree_ebsin-3.1.1.1 spec/features/admin_payment_method_spec.rb