summaryrefslogtreecommitdiff
path: root/spec/models/solidus_subscriptions/installment_detail_spec.rb
blob: 58662601ad3b1d119576231173d8a43e4e270e2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

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