Sha256: ebeecf099bf8c333982732525b583ef9bfc2afa31cf113ff6d83b714e27810db

Contents?: true

Size: 704 Bytes

Versions: 17

Compression:

Stored size: 704 Bytes

Contents

require 'spec_helper'

describe CurationConcerns::Renderers::ExternalLinkAttributeRenderer do
  let(:field) { :name }
  let(:renderer) { described_class.new(field, ['http://example.com']) }

  describe "#attribute_to_html" do
    subject { Nokogiri::HTML(renderer.render) }
    let(:expected) { Nokogiri::HTML(tr_content) }

    let(:tr_content) {
      "<tr><th>Name</th>\n" \
       "<td><ul class='tabular'>" \
       "<li class=\"attribute name\">"\
       "<a href=\"http://example.com\">"\
       "<span class='glyphicon glyphicon-new-window'></span>&nbsp;"\
       "http://example.com</a></li>\n" \
       "</ul></td></tr>"
    }
    it { expect(subject).to be_equivalent_to(expected) }
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.7.7 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-2.0.0 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-2.0.0.rc2 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.7.6 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.7.5 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.7.4 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.7.3 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.7.2 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-2.0.0.rc1 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.7.1 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.7.0 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.7.0.beta1 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.6.3 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.6.2 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.6.1 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb
curation_concerns-1.6.0 spec/renderers/curation_concerns/renderers/external_link_attribute_renderer_spec.rb