Sha256: d8dd1810283e74d139a32ff3f9f13ec7fac539402eb0614726632882e9e6bb9d

Contents?: true

Size: 662 Bytes

Versions: 2

Compression:

Stored size: 662 Bytes

Contents

require 'rails_helper'

module MnoEnterprise
  RSpec.describe Organization, type: :model do
    describe '#payment_restriction' do
      let(:organization) { FactoryGirl.build(:organization) }
      subject { organization.payment_restriction }

      context 'without metadata' do
        it { is_expected.to be nil }
      end

      context 'without payment restriction' do
        before { organization.meta_data = {} }
        it { is_expected.to be nil }
      end

      context 'with payment restriction' do
        before { organization.meta_data = {payment_restriction: ['visa']} }
        it { is_expected.to eq(['visa']) }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mno-enterprise-core-3.2.1 spec/models/mno_enterprise/organization_spec.rb
mno-enterprise-core-3.2.0 spec/models/mno_enterprise/organization_spec.rb