Sha256: b7a6da02bbc253c3df4f6c710f1000e5fcbedb23a3b5dbf61c0772ffe3699690

Contents?: true

Size: 1.2 KB

Versions: 10

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

describe Hyrax::Renderers::DateAttributeRenderer do
  subject { Nokogiri::HTML(renderer.render) }
  let(:expected) { Nokogiri::HTML(tr_content) }

  describe "#attribute_to_html" do
    context 'with embargo release date' do
      let(:field) { :embargo_release_date }
      let(:renderer) { described_class.new(field, ['2013-03-14T00:00:00Z']) }
      let(:tr_content) do
        %(
      <tr><th>Embargo release date</th>
      <td><ul class="tabular">
      <li class="attribute embargo_release_date">03/14/2013</li>
      </ul></td></tr>
      )
      end
      it { expect(renderer).not_to be_microdata(field) }
      it { expect(subject).to be_equivalent_to(expected) }
    end

    context 'with lease expiration date' do
      let(:field) { :lease_expiration_date }
      let(:renderer) { described_class.new(field, ['2013-03-14T00:00:00Z']) }
      let(:tr_content) do
        %(
      <tr><th>Lease expiration date</th>
      <td><ul class="tabular">
      <li class="attribute lease_expiration_date">03/14/2013</li>
      </ul></td></tr>
      )
      end
      it { expect(renderer).not_to be_microdata(field) }
      it { expect(subject).to be_equivalent_to(expected) }
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

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