summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/solidus_subscriptions/factories.rb4
-rw-r--r--lib/solidus_subscriptions/processor.rb2
-rw-r--r--lib/solidus_subscriptions/testing_support/factories/subscription_factory.rb6
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/solidus_subscriptions/factories.rb b/lib/solidus_subscriptions/factories.rb
deleted file mode 100644
index 745a01e..0000000
--- a/lib/solidus_subscriptions/factories.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-# frozen_string_literal: true
-
-FactoryBot.define do
-end
diff --git a/lib/solidus_subscriptions/processor.rb b/lib/solidus_subscriptions/processor.rb
index ef3ec59..96717cc 100644
--- a/lib/solidus_subscriptions/processor.rb
+++ b/lib/solidus_subscriptions/processor.rb
@@ -58,7 +58,7 @@ module SolidusSubscriptions
def build_jobs
users.map do |user|
installemts_by_address_and_user = installments(user).group_by do |i|
- i.subscription.shipping_address_id
+ [i.subscription.shipping_address_id, i.subscription.billing_address_id]
end
installemts_by_address_and_user.values.each do |grouped_installments|
diff --git a/lib/solidus_subscriptions/testing_support/factories/subscription_factory.rb b/lib/solidus_subscriptions/testing_support/factories/subscription_factory.rb
index cdbea1e..87fe75d 100644
--- a/lib/solidus_subscriptions/testing_support/factories/subscription_factory.rb
+++ b/lib/solidus_subscriptions/testing_support/factories/subscription_factory.rb
@@ -20,10 +20,14 @@ FactoryBot.define do
line_items { build_list :subscription_line_item, 1, *line_item_traits }
end
- trait :with_address do
+ trait :with_shipping_address do
association :shipping_address, factory: :address
end
+ trait :with_billing_address do
+ association :billing_address, factory: :address
+ end
+
trait :actionable do
with_line_item
actionable_date { Time.zone.now.yesterday.beginning_of_minute }