editable elements are not considered as blank blocks anymore if they are empty by default

did committed Mar 07, 2016
commit 64fffd58f1440e981b7bb89773d068aafe66897e
Showing 2 changed files with 10 additions and 0 deletions
locomotive/steam/liquid/tags/editable/base.rb b/lib/locomotive/steam/liquid/tags/editable/base.rb +4 -0
@@ @@ -47,6 +47,10 @@ module Locomotive
end
end
+ def blank?
+ false
+ end
+
protected
def render_default_content
spec/unit/liquid/tags/editable/file_spec.rb +6 -0
@@ @@ -145,6 +145,12 @@ describe Locomotive::Steam::Liquid::Tags::Editable::File do
end
+ context 'no default file and inside a capture block' do
+ let(:source) { "{% capture url %}{% editable_file banner, hint: 'some text' %}{% endeditable_file %}{% endcapture %}->{{ url }}" }
+ let(:element) { instance_double('EditableFile', id: 42, default_source_url: nil, source?: true, source: '/foo/bar', content: nil, base_url: '') }
+ it { is_expected.to eq '->/foo/bar?1183150800' }
+ end
+
end
end