Sha256: 00f0f3f2b3e8ba14abfedb4371831b8d38650de362b55c526a2084f8b5fd33a2

Contents?: true

Size: 915 Bytes

Versions: 9

Compression:

Stored size: 915 Bytes

Contents

require 'spec_helper'

describe 'alchemy/essences/_essence_link_view' do
  let(:essence) { Alchemy::EssenceLink.new(link: 'http://google.com') }
  let(:content) { Alchemy::Content.new(essence: essence) }
  let(:options) { {} }

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

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

  it "renders a link" do
    render content, content: content, options: options, html_options: {}
    expect(rendered).to eq('<a href="http://google.com">http://google.com</a>')
  end

  context 'with text option' do
    let(:options) { {text: 'Google'} }

    it "renders a link" do
      render content, content: content, options: options, html_options: {}
      expect(rendered).to eq('<a href="http://google.com">Google</a>')
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-3.0.4 spec/views/essences/essence_link_view_spec.rb
alchemy_cms-3.0.3 spec/views/essences/essence_link_view_spec.rb
alchemy_cms-3.0.2 spec/views/essences/essence_link_view_spec.rb
alchemy_cms-3.0.1 spec/views/essences/essence_link_view_spec.rb
alchemy_cms-3.0.0 spec/views/essences/essence_link_view_spec.rb
alchemy_cms-3.0.0.rc8 spec/views/essences/essence_link_view_spec.rb
alchemy_cms-3.0.0.rc7 spec/views/essences/essence_link_view_spec.rb
alchemy_cms-3.0.0.rc6 spec/views/essences/essence_link_view_spec.rb
alchemy_cms-3.0.0.rc5 spec/views/essences/essence_link_view_spec.rb