diff options
author | Alex Blackie <alex@alexblackie.com> | 2016-09-22 13:23:34 -0700 |
---|---|---|
committer | Alex Blackie <alex@alexblackie.com> | 2016-09-22 16:38:41 -0700 |
commit | 733851c34e25274b0030ee3ac5fefbefbeefa9eb (patch) | |
tree | b56c94cc64cbef18b965c0640b8a3cbfea8b0515 /lib/solidus_subscriptions/testing_support | |
parent | 952c726b61576173bd3a00beacfe5927a1ad8313 (diff) |
Refactor interval to be stored more generically
Forcing consumers of the API to calculate and provide the interval in
seconds is messy and unnecessary. Instead, we can store the interval as
length and units, and do the math ourselves. This makes the API much
easier to use and understand.
Diffstat (limited to 'lib/solidus_subscriptions/testing_support')
-rw-r--r-- | lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb b/lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb index af93720..6a3304b 100644 --- a/lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb +++ b/lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb @@ -2,7 +2,8 @@ FactoryGirl.define do factory :subscription_line_item, class: 'SolidusSubscriptions::LineItem' do subscribable_id { create(:variant, subscribable: true).id } quantity 1 - interval 30.days + interval_length 1 + interval_units :months association :spree_line_item, factory: :line_item |