Sha256: 0348cc84c7670b5487e382f555a68f7e311f95f2932b88f51f6234948b98f8d7

Contents?: true

Size: 1022 Bytes

Versions: 7

Compression:

Stored size: 1022 Bytes

Contents

require 'spec_helper'

# https://github.com/bblimke/webmock
require 'webmock/rspec'

describe MintPurl do

  subject { MintPurl.new(fedora_object) }
  let(:pid) { "TEST:#{noid}" }
  let(:noid) { '1234' }
  let(:bad_fedora_object) { nil }
  let(:create_date) { DateTime.new(2000,-11,-26,-20,-55,-54,'+7') }
  let(:date_added) { DateTime.new(2001,-11,-26,-20,-55,-54,'+7') }
  let(:modified_date) { DateTime.new(2002,-11,-26,-20,-55,-54,'+7') }

  let(:fedora_object) {
    double(
      'FedoraObject',
      to_param: noid,
      date_added: date_added,
      modified_date: modified_date,
      create_date: create_date
    )
  }

  let(:expected_purl_link) { "http://localhost:3000/view/1/#{noid}" }

  it 'requires a fedora object that is present and responds to_param' do
    expect { MintPurl.new(bad_fedora_object) }.to raise_error(ArgumentError)
  end

  describe 'create_or_retreive_purl' do
    it 'should return purl link' do
      subject.create_or_retreive_purl.should == expected_purl_link
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
curate-0.3.2 spec/models/mint_purl_spec.rb
curate-0.3.1 spec/models/mint_purl_spec.rb
curate-0.2.0 spec/models/mint_purl_spec.rb
curate-0.1.3 spec/models/mint_purl_spec.rb
curate-0.1.2 spec/models/mint_purl_spec.rb
curate-0.1.1 spec/models/mint_purl_spec.rb
curate-0.1.0 spec/models/mint_purl_spec.rb