Sha256: 61d7ca1d6a9eb86c4ef36f7436d39b397d5d99abf89575c5928467ed427bdbaa
Contents?: true
Size: 1.23 KB
Versions: 18
Compression:
Stored size: 1.23 KB
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 context 'with text setting on content description' do before do allow(content).to receive(:settings).and_return({text: 'Yahoo'}) end it "renders a link" do render content.essence, content: content, options: options, html_options: {} expect(rendered).to eq('<a href="http://google.com">Yahoo</a>') end end end
Version data entries
18 entries across 18 versions & 2 rubygems