Sha256: 44e90367fa7cfc89a535092a5ef7f20c2846570233aeca06230af21848002816
Contents?: true
Size: 1.38 KB
Versions: 28
Compression:
Stored size: 1.38 KB
Contents
require 'test_helper' module Workarea module Admin class SettingsHelperTest < ViewTest include ERB::Util def test_sanitize_config_value assert(sanitize_config_value([]).blank?) assert(sanitize_config_value('').blank?) assert(sanitize_config_value(nil).blank?) assert_equal( '<code class="code code--block">foo</code>', sanitize_config_value('foo') ) assert_equal( '<code class="code code--block">:foo</code>', sanitize_config_value(':foo') ) assert_equal( '<code class="code code--block">3</code>', sanitize_config_value(3) ) assert_equal( '<code class="code code--block">false</code>', sanitize_config_value(false) ) assert_equal( '<code class="code code--block">30 days</code>', sanitize_config_value(30.days) ) assert_match( /pre.*expandable.*code.*{\n.*foo.*bar.*\n.*}/, sanitize_config_value({ foo: 'bar' }) ) assert_match( /pre.*expandable.*code.*\[\n.*foo.*\n.*bar.*\n.*\]/, sanitize_config_value(['foo', 'bar']) ) assert_match( /pre.*expandable.*code.*\[\n.*foo.*\n.*bar.*\n.*\]/, sanitize_config_value(SwappableList.new(['foo', 'bar'])) ) end end end end
Version data entries
28 entries across 28 versions & 1 rubygems