summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorAlessandro Desantis <desa.alessandro@gmail.com>2020-06-16 16:50:23 +0200
committerAlessandro Desantis <desa.alessandro@gmail.com>2020-06-16 17:54:20 +0200
commit67cca5d52862bf64436bf1e9e37c0048a4b4bd3d (patch)
tree61e3acded44f34fd96ad58ecb6d31401c78399a9 /spec/models
parent00bc77403f0a1ec27b48a31fb3c23cde31da4c81 (diff)
Use subscription's `end_date` in `Subscription#can_be_deactivated?`
This is necessary because the end date is not stored on line items anymore, meaning that the line item's end_date will always be nil.
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/solidus_subscriptions/subscription_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/models/solidus_subscriptions/subscription_spec.rb b/spec/models/solidus_subscriptions/subscription_spec.rb
index 11b28f9..c54eca2 100644
--- a/spec/models/solidus_subscriptions/subscription_spec.rb
+++ b/spec/models/solidus_subscriptions/subscription_spec.rb
@@ -100,16 +100,16 @@ RSpec.describe SolidusSubscriptions::Subscription, type: :model do
describe '#deactivate' do
subject { subscription.deactivate }
- let(:traits) { [] }
+ let(:attributes) { {} }
let(:subscription) do
- create :subscription, :actionable, :with_line_item, line_item_traits: traits do |s|
+ create :subscription, :actionable, :with_line_item, attributes do |s|
s.installments = build_list(:installment, 2)
end
end
context 'the subscription can be deactivated' do
- let(:traits) do
- [{ end_date: Date.current.ago(2.days) }]
+ let(:attributes) do
+ { end_date: Date.current.ago(2.days) }
end
it 'is inactive' do