Sha256: be963dabe73f24bf537f9dbceb9414c486b6e5643ef7fff97466cc7c7bb49455
Contents?: true
Size: 1.59 KB
Versions: 29
Compression:
Stored size: 1.59 KB
Contents
require 'spec_helper' require 'copy_tuner_client/copyray' describe CopyTunerClient::Copyray do describe '.augment_template' do subject { CopyTunerClient::Copyray.augment_template(source, key) } let(:key) { 'en.test.key' } shared_examples 'Not escaped' do it { is_expected.to be_html_safe } it { is_expected.to eq "<!--COPYRAY #{key}--><b>Hello</b>" } end context 'html_escape option is false' do before do CopyTunerClient.configure do |configuration| configuration.html_escape = false configuration.client = FakeClient.new end end context 'string not marked as html safe' do let(:source) { FakeHtmlSafeString.new('<b>Hello</b>') } it_behaves_like 'Not escaped' end context 'string marked as html safe' do let(:source) { FakeHtmlSafeString.new('<b>Hello</b>').html_safe } it_behaves_like 'Not escaped' end end context 'html_escape option is true' do before do CopyTunerClient.configure do |configuration| configuration.html_escape = true configuration.client = FakeClient.new end end context 'string not marked as html safe' do let(:source) { FakeHtmlSafeString.new('<b>Hello</b>') } it { is_expected.to be_html_safe } it { is_expected.to eq "<!--COPYRAY #{key}--><b>Hello</b>" } end context 'string marked as html safe' do let(:source) { FakeHtmlSafeString.new('<b>Hello</b>').html_safe } it_behaves_like 'Not escaped' end end end end
Version data entries
29 entries across 29 versions & 1 rubygems