summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAlessandro Desantis <desa.alessandro@gmail.com>2020-06-17 13:33:56 +0200
committerAlessandro Desantis <desa.alessandro@gmail.com>2020-06-17 13:51:25 +0200
commite3f2712d962630021560a3fc945cfb78868f3b83 (patch)
tree499e5dac5ad8ece2ad1d09bd2111aaf24d68fb17 /spec
parentaeac07481f55ccdb42d1f737e5108b684f5e18da (diff)
Group subscriptions by billing and shipping addresses for scheduling
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/solidus_subscriptions/processor_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/solidus_subscriptions/processor_spec.rb b/spec/lib/solidus_subscriptions/processor_spec.rb
index f88af01..96ac9f9 100644
--- a/spec/lib/solidus_subscriptions/processor_spec.rb
+++ b/spec/lib/solidus_subscriptions/processor_spec.rb
@@ -107,6 +107,16 @@ RSpec.describe SolidusSubscriptions::Processor, :checkout do
expect { subject }.to change { Spree::Order.complete.count }.by 2
end
end
+
+ context 'the subscriptions have different billing addresses' do
+ let!(:sub_to_different_address) do
+ create(:subscription, :actionable, :with_billing_address, user: user)
+ end
+
+ it 'creates an order for each billing address' do
+ expect { subject }.to change { Spree::Order.complete.count }.by 2
+ end
+ end
end
describe '.run' do