Sha256: 73f6ab17909d1a692ca4a918eb2ec00bfbf01775713e996883af921f6aff0d59

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

describe Spree::Gateway::BraintreeVzeroDropInUi, :vcr do
  subject { create(:vzero_dropin_ui_gateway) }

  describe 'after_save' do
    let(:hosted_fields_gateway) { create(:vzero_hosted_fields_gateway) }

    it 'activation should disable Hosted Fields Gateways' do
      subject.update_column(:active, false)
      expect(hosted_fields_gateway.active?).to be true
      subject.update(active: true)
      expect(hosted_fields_gateway.reload.active?).to be false
    end

    it 'deactivation should not disable Hosted Fields Gateways' do
      subject
      expect(hosted_fields_gateway.active?).to be true
      subject.update(active: false)
      expect(hosted_fields_gateway.reload.active?).to be true
    end

    it 'creation of activated should disable Hosted Fields Gateways' do
      expect(hosted_fields_gateway.active?).to be true
      subject
      expect(hosted_fields_gateway.reload.active?).to be false
    end

    it 'creation of deactivated should not disable Hosted Fields Gateways' do
      expect(hosted_fields_gateway.active?).to be true
      create(:vzero_dropin_ui_gateway, active: false)
      expect(hosted_fields_gateway.reload.active?).to be true
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_braintree_vzero-3.6.0 spec/models/gateway/braintree_vzero_dropin_ui_spec.rb
spree_braintree_vzero-3.5.1 spec/models/gateway/braintree_vzero_dropin_ui_spec.rb