Skip to content

Commit 4c1baa6

Browse files
Merge pull request #60 from akretion/v4.0.x-fix-steam-version
[FIX] fix erp tag linked to steam version
2 parents c7016e7 + 37ddf38 commit 4c1baa6

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
44
# Specify your gem's dependencies in shop_invader.gemspec
55
gemspec
66

7-
gem 'locomotivecms_steam', github: 'akretion/steam', branch: 'better-attribute-parser'
7+
gem 'locomotivecms_steam', github: 'akretion/steam', branch: 'rebase-better-attribute-parser'
88
gem 'faraday'
99
gem 'algoliasearch'
1010
gem 'elasticsearch'

lib/shop_invader/liquid/tags/erp.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def initialize(tag_name, markup, options)
4646
end
4747

4848
def render(context)
49-
if @attributes
49+
if @raw_attributes
5050
evaluate_attributes(context)
5151
end
5252
@context = context

spec/liquid/tags/erp_spec.rb

+8
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@
5555
it { is_expected.to eq '{"name"=>"SO42", "total"=>42}' }
5656
end
5757

58+
describe 'validates syntax with dynamic params and result and render it' do
59+
let(:assigns) { { 'params' => Locomotive::Steam::Liquid::Drops::Params.new({ foo: 'bar' }) } }
60+
let(:source) { "{% erp get 'sale_order' as sale with foo: params.foo %}{{ sale }}" }
61+
let(:params) { ['GET', 'sale_order', {'foo': 'bar'}]}
62+
it { expect { subject }.not_to raise_exception }
63+
it { is_expected.to eq '{"name"=>"SO42", "total"=>42}' }
64+
end
65+
5866
describe 'raises an error if the syntax is incorrect' do
5967
let(:source) { "{% erp get as sale with 42 %}{{ sale }}" }
6068
it { expect { subject }.to raise_exception(Liquid::SyntaxError) }

0 commit comments

Comments
 (0)