summaryrefslogtreecommitdiff
path: root/spec/models/solidus_subscriptions/installment_detail_spec.rb
blob: 53f0b53c0a75e472631828ebcabe92384a829cb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'spec_helper'

RSpec.describe SolidusSubscriptions::InstallmentDetail, type: :model do
  it { is_expected.to validate_presence_of :installment }

  describe '#failed?' do
    subject { build(:installment_detail, success: success).failed? }

    context 'the detail was successful' do
      let(:success) { true }

      it { is_expected.to be_falsy }
    end

    context 'the detail was not successfuly' do
      let(:success) { false }

      it { is_expected.to be_truthy }
    end
  end
end