Sha256: 3327d4c9cc318f250e35d5db8cc40b335bc7e65bdee6ec8287c78604d7a54f8f

Contents?: true

Size: 626 Bytes

Versions: 13

Compression:

Stored size: 626 Bytes

Contents

require 'spec_helper'

describe CurationConcerns::UrlHelper do
  subject { helper.url_for_document(document) }

  context 'when document is a SolrDocument that points at a Work' do
    let(:work) { create(:generic_work) }
    let(:document) { SolrDocument.new(work.to_solr) }
    it "forms the correct path" do
      expect(polymorphic_path(subject)).to eq "/concern/generic_works/#{work.id}"
    end
  end

  context 'when document is a FileSet' do
    let(:document) { create(:file_set) }
    it "forms the correct path" do
      expect(polymorphic_path(subject)).to eq "/concern/file_sets/#{document.id}"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/helpers/url_helper_spec.rb
curation_concerns-1.7.7 spec/helpers/url_helper_spec.rb
curation_concerns-2.0.0 spec/helpers/url_helper_spec.rb
curation_concerns-2.0.0.rc2 spec/helpers/url_helper_spec.rb
curation_concerns-1.7.6 spec/helpers/url_helper_spec.rb
curation_concerns-1.7.5 spec/helpers/url_helper_spec.rb
curation_concerns-1.7.4 spec/helpers/url_helper_spec.rb
curation_concerns-1.7.3 spec/helpers/url_helper_spec.rb
curation_concerns-1.7.2 spec/helpers/url_helper_spec.rb
curation_concerns-2.0.0.rc1 spec/helpers/url_helper_spec.rb
curation_concerns-1.7.1 spec/helpers/url_helper_spec.rb
curation_concerns-1.7.0 spec/helpers/url_helper_spec.rb
curation_concerns-1.7.0.beta1 spec/helpers/url_helper_spec.rb