Sha256: 25225d83bbf5ab33b1164ff0b745ac84b49602c4223f3c4e97e2d1274f83a65d

Contents?: true

Size: 630 Bytes

Versions: 6

Compression:

Stored size: 630 Bytes

Contents

require 'spec_helper'

describe Worthwhile::UrlHelper do
  before do
    GenericWork.destroy_all
  end
  let(:profile) { ["{\"datastreams\":{}}"] }
  let(:work) { GenericWork.create!(pid: 'sufia:123') }
  let(:document) { SolrDocument.new("id"=>"sufia:123", "has_model_ssim"=>["info:fedora/afmodel:GenericWork"], 'object_profile_ssm' => profile) }
  subject { helper.url_for_document document }

  it { should eq "/concern/generic_works/123" }

  context "when document is a Worthwhile::GenericFile" do
    let(:document) { Worthwhile::GenericFile.new pid: 'foo:123' }
    it { should eq "/concern/generic_files/123" }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
worthwhile-0.1.2 spec/helpers/url_helper_spec.rb
worthwhile-0.1.1 spec/helpers/url_helper_spec.rb
worthwhile-0.1.0 spec/helpers/url_helper_spec.rb
worthwhile-0.0.3 spec/helpers/url_helper_spec.rb
worthwhile-0.0.2 spec/helpers/url_helper_spec.rb
worthwhile-0.0.1 spec/helpers/url_helper_spec.rb