Sha256: 92c8aac34718fde72fcd2decd3f8bdcbf30c10892c29087a5efe33e82aa6dd98

Contents?: true

Size: 601 Bytes

Versions: 28

Compression:

Stored size: 601 Bytes

Contents

require 'spec_helper'

describe 'alchemy/essences/_essence_html_view' do
  let(:essence) { Alchemy::EssenceHtml.new(source: '<script>alert("hacked");</script>') }
  let(:content) { Alchemy::Content.new(essence: essence) }

  context 'without value' do
    let(:essence) { Alchemy::EssenceHtml.new(source: nil) }

    it "renders nothing" do
      render content, content: content
      expect(rendered).to eq('')
    end
  end

  context 'with value' do
    it "renders the raw html source" do
      render content, content: content
      expect(rendered).to have_selector("script")
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
alchemy_cms-3.3.0.rc1 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.2.1 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.1.3 spec/views/essences/essence_html_view_spec.rb
lc_alchemy_cms-3.2.1 spec/views/essences/essence_html_view_spec.rb
lc_alchemy_cms-3.2.0 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.2.0 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.2.0.rc1 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.2.0.beta spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.1.1 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.0.4 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.1.0 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.1.0.rc3 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.1.0.rc2 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.1.0.rc1 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.1.0.beta6 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.1.0.beta5 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.1.0.beta4 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.0.3 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.1.0.beta3 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.1.0.beta2 spec/views/essences/essence_html_view_spec.rb