Sha256: 665e9ff856b951ada625d726445be61d593ceac61178270afffc7a84b4874245

Contents?: true

Size: 1 KB

Versions: 2

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe 'curation_concerns/base/_attributes.html.erb' do
  let(:creator)     { 'Bilbo' }
  let(:contributor) { 'Frodo' }
  let(:subject)     { 'history' }

  let(:solr_document) { SolrDocument.new(subject_tesim: subject,
                                         contributor_tesim: contributor,
                                         creator_tesim: creator) }
  let(:ability) { nil }
  let(:presenter) do
    CurationConcerns::WorkShowPresenter.new(solr_document, ability)
  end

  before do
    allow(view).to receive(:dom_class) { '' }

    assign(:presenter, presenter)
    render
  end

  it 'has links to search for other objects with the same metadata' do
    expect(rendered).to have_link(creator, href: catalog_index_path(search_field: 'creator', q: creator))
    expect(rendered).to have_link(contributor, href: catalog_index_path(search_field: 'contributor', q: contributor))
    expect(rendered).to have_link(subject, href: catalog_index_path(search_field: 'subject', q: subject))
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
curation_concerns-0.3.0 spec/views/curation_concerns/base/_attributes.html.erb_spec.rb
curation_concerns-0.2.0 spec/views/curation_concerns/base/_attributes.html.erb_spec.rb