Sha256: 8aa3f57b3028c1941bced9e3df9a639a40a866707cc9aa3a3fc013f0ebef635a

Contents?: true

Size: 741 Bytes

Versions: 10

Compression:

Stored size: 741 Bytes

Contents

require 'spec_helper'

describe Hyrax::Renderers::FacetedAttributeRenderer do
  let(:field) { :name }
  let(:renderer) { described_class.new(field, ['Bob', 'Jessica']) }

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

    let(:tr_content) do
      %(
      <tr><th>Name</th>
      <td><ul class='tabular'>
      <li class="attribute name"><a href="/catalog?f%5Bname_sim%5D%5B%5D=Bob">Bob</a></li>
      <li class="attribute name"><a href="/catalog?f%5Bname_sim%5D%5B%5D=Jessica">Jessica</a></li>
      </ul></td></tr>
    )
    end
    it { expect(renderer).not_to be_microdata(field) }
    it { expect(subject).to be_equivalent_to(expected) }
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb
hyrax-1.1.0 spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb
hyrax-1.0.5 spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb
hyrax-1.0.4 spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb
hyrax-1.0.3 spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb
hyrax-1.0.2 spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb
hyrax-1.0.1 spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb
hyrax-1.0.0.rc2 spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb
hyrax-1.0.0.rc1 spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb
test_hyrax-0.0.1.alpha spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb