Sha256: f4894da87aee01de1bfbf45c2f3a1c508606ed58e274255a416731cc9f850466

Contents?: true

Size: 1.7 KB

Versions: 1

Compression:

Stored size: 1.7 KB

Contents

describe 'catalog/_index_list_default', type: :view do
  let(:attributes) do
    { 'creator_tesim' => [''],
      'depositor_tesim' => [''],
      'proxy_depositor_ssim' => [''],
      'description_tesim' => [''],
      'date_uploaded_dtsi' => 'a date',
      'rights_tesim' => [''] }
  end
  let(:document) { SolrDocument.new(attributes) }
  let(:blacklight_configuration_context) do
    Blacklight::Configuration::Context.new(controller)
  end
  before do
    allow(view).to receive(:blacklight_config).and_return(CatalogController.blacklight_config)
    allow(view).to receive(:blacklight_configuration_context).and_return(blacklight_configuration_context)
    allow(view).to receive(:render_index_field_value) { |_, conf| "Test #{conf[:field]}" }
    render 'catalog/index_list_default', document: document
  end

  it "displays metadata" do
    expect(rendered).not_to include 'Title:'
    expect(rendered).to include '<span class="attribute-label h4">Creator:</span>'
    expect(rendered).to include 'Test creator_tesim'
    expect(rendered).to include '<span class="attribute-label h4">Description:</span>'
    expect(rendered).to include 'Test description_tesim'
    expect(rendered).to include '<span class="attribute-label h4">Date Uploaded:</span>'
    expect(rendered).to include 'Test date_uploaded_dtsi'
    expect(rendered).to include '<span class="attribute-label h4">Depositor:</span>'
    expect(rendered).to include 'Test proxy_depositor_ssim'
    expect(rendered).to include '<span class="attribute-label h4">Owner:</span>'
    expect(rendered).to include 'Test depositor_tesim'
    expect(rendered).to include '<span class="attribute-label h4">Rights:</span>'
    expect(rendered).to include 'Test rights_tesim'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sufia-7.0.0.beta4 spec/views/catalog/_index_list_default.html.erb_spec.rb