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.1.0.beta1 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.0.2 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.0.1 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.0.0 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.0.0.rc8 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.0.0.rc7 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.0.0.rc6 spec/views/essences/essence_html_view_spec.rb
alchemy_cms-3.0.0.rc5 spec/views/essences/essence_html_view_spec.rb