Sha256: 47c65734f70a557a7234aae9a51b2737e6443bf4639d1a682ff6808aab6e9ee4

Contents?: true

Size: 620 Bytes

Versions: 10

Compression:

Stored size: 620 Bytes

Contents

require 'spec_helper'

RSpec.describe SolidusBolt::PaymentSource, type: :model do
  let(:payment_source) { build(:bolt_payment_source) }

  describe 'validations' do
    context 'with payment_method_id present' do
      it 'is valid' do
        expect(payment_source.valid?).to be(true)
      end
    end

    context 'with payment_method_id absent' do
      before { payment_source.payment_method_id = nil }

      it 'is invalid' do
        expect(payment_source.valid?).to be(false)
        expect(payment_source.errors.messages.first.to_a).to eq([:payment_method_id, ["can't be blank"]])
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
solidus_bolt-0.7.2 spec/models/solidus_bolt/payment_source_spec.rb
solidus_bolt-0.7.1 spec/models/solidus_bolt/payment_source_spec.rb
solidus_bolt-0.7.0 spec/models/solidus_bolt/payment_source_spec.rb
solidus_bolt-0.6.0 spec/models/solidus_bolt/payment_source_spec.rb
solidus_bolt-0.5.0 spec/models/solidus_bolt/payment_source_spec.rb
solidus_bolt-0.4.0 spec/models/solidus_bolt/payment_source_spec.rb
solidus_bolt-0.3.0 spec/models/solidus_bolt/payment_source_spec.rb
solidus_bolt-0.2.0 spec/models/solidus_bolt/payment_source_spec.rb
solidus_bolt-0.1.0 spec/models/solidus_bolt/payment_source_spec.rb
solidus_bolt-0.0.1 spec/models/solidus_bolt/payment_source_spec.rb