Sha256: 5d6150a2f9b67447550986cd574da57a79009c3051f3762aa343d9944f44d35a

Contents?: true

Size: 1.17 KB

Versions: 24

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe CurationConcerns::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) {%(
      <tr><th>Embargo release date</th>
      <td><ul class="tabular">
      <li class="attribute embargo_release_date">03/14/2013</li>
      </ul></td></tr>
      )}
      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) {%(
      <tr><th>Lease expiration date</th>
      <td><ul class="tabular">
      <li class="attribute lease_expiration_date">03/14/2013</li>
      </ul></td></tr>
      )}
      it { expect(renderer).not_to be_microdata(field) }
      it { expect(subject).to be_equivalent_to(expected) }
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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