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