Skip to content

Commit

Permalink
Checkout multiple subscription_line_items
Browse files Browse the repository at this point in the history
Add a spec to test that the checkout is successful when the subscription
includes multiple line items
  • Loading branch information
Brendan committed Feb 3, 2017
1 parent 8118ba4 commit 48decc5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/models/solidus_subscriptions/checkout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,24 @@
expect(subject.ship_address).to eq shipping_address
end
end

context 'there are multiple associated subscritpion line items' do
it_behaves_like 'a completed checkout' do
let(:quantity) { subscription_line_items.length }
end

let(:installments) { create_list(:installment, 1, installment_traits) }
let(:subscription_line_items) { create_list(:subscription_line_item, 2, quantity: 1) }

let(:installment_traits) do
{
subscription_traits: [{
user: subscription_user,
line_items: subscription_line_items
}]
}
end
end
end

describe '#order' do
Expand Down

0 comments on commit 48decc5

Please sign in to comment.