summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/jobs/solidus_subscriptions/process_installments_job_spec.rb1
-rw-r--r--spec/models/solidus_subscriptions/consolidated_installment_spec.rb10
2 files changed, 11 insertions, 0 deletions
diff --git a/spec/jobs/solidus_subscriptions/process_installments_job_spec.rb b/spec/jobs/solidus_subscriptions/process_installments_job_spec.rb
index 31a9af6..56b8b4d 100644
--- a/spec/jobs/solidus_subscriptions/process_installments_job_spec.rb
+++ b/spec/jobs/solidus_subscriptions/process_installments_job_spec.rb
@@ -5,6 +5,7 @@ RSpec.describe SolidusSubscriptions::ProcessInstallmentsJob do
let(:installments) do
traits = {
subscription_traits: [{
+ user: root_order.user,
line_item_traits: [{
spree_line_item: root_order.line_items.first
}]
diff --git a/spec/models/solidus_subscriptions/consolidated_installment_spec.rb b/spec/models/solidus_subscriptions/consolidated_installment_spec.rb
index 194915d..6bffdf4 100644
--- a/spec/models/solidus_subscriptions/consolidated_installment_spec.rb
+++ b/spec/models/solidus_subscriptions/consolidated_installment_spec.rb
@@ -17,6 +17,16 @@ RSpec.describe SolidusSubscriptions::ConsolidatedInstallment do
create_list(:installment, 2, traits)
end
+ context 'initialized with installments belonging to multiple users' do
+ subject { consolidated_installment }
+ let(:installments) { build_stubbed_list :installment, 2 }
+
+ it 'raises an error' do
+ expect { subject }.
+ to raise_error SolidusSubscriptions::UserMismatchError, /must have the same user/
+ end
+ end
+
describe '#process', :checkout do
subject(:order) { consolidated_installment.process }
let(:subscription_line_item) { installments.first.subscription.line_item }