From 091362cb003c6c96073621da66132bb5a76021e1 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Tue, 14 Mar 2023 16:34:58 +0100 Subject: [PATCH] Remove subscription requirement for field interpolation. --- lib/custom_wizard/mapper.rb | 2 +- spec/components/custom_wizard/mapper_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/custom_wizard/mapper.rb b/lib/custom_wizard/mapper.rb index 410a50e4..9d26c82e 100644 --- a/lib/custom_wizard/mapper.rb +++ b/lib/custom_wizard/mapper.rb @@ -255,7 +255,7 @@ class CustomWizard::Mapper end end - if opts[:template] && CustomWizard::Subscription.subscribed? + if opts[:template] #&& CustomWizard::Subscription.subscribed? template = Liquid::Template.parse(string) string = template.render(data) end diff --git a/spec/components/custom_wizard/mapper_spec.rb b/spec/components/custom_wizard/mapper_spec.rb index 56778a07..f460cc01 100644 --- a/spec/components/custom_wizard/mapper_spec.rb +++ b/spec/components/custom_wizard/mapper_spec.rb @@ -373,7 +373,7 @@ describe CustomWizard::Mapper do expect(result).to eq(template_params["step_1_field_1"]) end - it "requires a subscription" do + it "does not require a subscription" do template = '{{ "w{step_1_field_1}" | size }}' mapper = create_template_mapper(template_params, user1) result = mapper.interpolate( @@ -383,7 +383,7 @@ describe CustomWizard::Mapper do wizard: true, value: true ) - expect(result).to eq("{{ \"#{template_params["step_1_field_1"]}\" | size }}") + expect(result).to eq("5") end context "with a subscription" do