diff options
author | Alessandro Desantis <desa.alessandro@gmail.com> | 2021-02-26 18:25:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-26 18:25:01 +0100 |
commit | 4d4bb04d14b0afd970f0f359f70ba13a8c5d5d5a (patch) | |
tree | 833b61da47ffdb403f4f694323544eeb82dd0539 /spec | |
parent | 5d965b6ac0b2b9fcb69d3b40cd274c3c9eef6355 (diff) | |
parent | 11fa55f3c6a6a6b95314d1967f354f48b3c17416 (diff) |
Merge pull request #202 from solidusio-contrib/mr/cleanup-duplicated-fields-on-order-finalize
Cleanup the duplicated fields on subscription creation
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/solidus_subscriptions/subscription_generator_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/lib/solidus_subscriptions/subscription_generator_spec.rb b/spec/lib/solidus_subscriptions/subscription_generator_spec.rb index bbf4e74..72cbfe6 100644 --- a/spec/lib/solidus_subscriptions/subscription_generator_spec.rb +++ b/spec/lib/solidus_subscriptions/subscription_generator_spec.rb @@ -45,6 +45,19 @@ RSpec.describe SolidusSubscriptions::SubscriptionGenerator do payment_source: payment_source, ) end + + it 'cleanups the subscription line items fields duplicated on the subscription' do + attrs = { interval_length: 2, interval_units: :week, end_date: Time.zone.tomorrow } + subscription_line_item = create(:subscription_line_item, attrs) + + described_class.activate([subscription_line_item]) + + expect(subscription_line_item.reload).to have_attributes( + interval_length: nil, + interval_units: nil, + end_date: nil + ) + end end describe '.group' do |