summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorluca-landa <lucalanda@hotmail.it>2021-01-29 14:48:07 +0100
committerluca-landa <lucalanda@hotmail.it>2021-01-29 17:19:51 +0100
commitb904fb5aa324b0907cba9bdd3c718ae9d704c536 (patch)
tree6a163cfe8d9e664405ebf638d8eaf1457d834f72 /spec
parente5d86f58ee464253dd7447cd4c25eabaa4e2a932 (diff)
Deprecate User subscription nested attributes
Diffstat (limited to 'spec')
-rw-r--r--spec/decorators/models/solidus_subscriptions/spree/user/have_many_subscriptions_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/decorators/models/solidus_subscriptions/spree/user/have_many_subscriptions_spec.rb b/spec/decorators/models/solidus_subscriptions/spree/user/have_many_subscriptions_spec.rb
index 66bbe61..a76f130 100644
--- a/spec/decorators/models/solidus_subscriptions/spree/user/have_many_subscriptions_spec.rb
+++ b/spec/decorators/models/solidus_subscriptions/spree/user/have_many_subscriptions_spec.rb
@@ -5,4 +5,16 @@ RSpec.describe SolidusSubscriptions::Spree::User::HaveManySubscriptions, type: :
it { is_expected.to have_many :subscriptions }
it { is_expected.to accept_nested_attributes_for :subscriptions }
+
+ describe '#subscriptions_attributes=' do
+ it 'throws a deprecation warning' do
+ allow(::Spree::Deprecation).to receive(:warn)
+
+ subject.subscriptions_attributes = [{ interval_length: 2 }]
+
+ expect(::Spree::Deprecation)
+ .to have_received(:warn)
+ .with(/Creating or updating subscriptions through Spree::User nested attributes is deprecated/)
+ end
+ end
end