diff --git a/app/helpers/locomotive/current_site_metafields_helper.rb b/app/helpers/locomotive/current_site_metafields_helper.rb index 1fe8405e5b..010e4085a3 100644 --- a/app/helpers/locomotive/current_site_metafields_helper.rb +++ b/app/helpers/locomotive/current_site_metafields_helper.rb @@ -74,7 +74,8 @@ def hint def type @type ||= case (type = @attributes['type'].try(:to_sym)) when :boolean then :toggle - when :text then :rte + when :text + @attributes['format'] == 'raw' ? :text : :rte else type || :string end diff --git a/spec/views/locomotive/current_site_metafields/index_spec.rb b/spec/views/locomotive/current_site_metafields/index_spec.rb index b3864d410d..24129a04d2 100644 --- a/spec/views/locomotive/current_site_metafields/index_spec.rb +++ b/spec/views/locomotive/current_site_metafields/index_spec.rb @@ -65,6 +65,23 @@ end + describe 'raw text field type' do + + let(:schema) { [ + { + 'name' => 'theme', + 'fields' => [ + { 'name' => 'footer_scripts', 'type' => 'text', 'format' => 'raw' } + ] + } + ] } + + it 'does not render wsiwyg editor' do + expect(subject).not_to include('wysihtml5-editor') + end + + end + end end