Sha256: a71bf81f83464cc93cee44545f7928e84173d57a790963a5f9233b16536d5fcc

Contents?: true

Size: 1.56 KB

Versions: 8

Compression:

Stored size: 1.56 KB

Contents

require 'spec_helper'

describe 'OIA-PMH Identify Request' do
  let(:xml) { Nokogiri::XML(response.body) }

  before do
    get '/catalog/oai?verb=Identify'
  end

  it "contains response date" do
    expect(Time.parse(xml.at_xpath('//xmlns:responseDate').text)).to be_within(5.seconds).of(Time.now)
  end

  it "contains repository name" do
    expect(xml.at_xpath('//xmlns:repositoryName').text).to eql 'Test Repository'
  end

  it "contains base url" do
    expect(xml.at_xpath('//xmlns:baseURL').text).to eql 'http://localhost/catalog/oai'
  end

  it "contains protocol version" do
    expect(xml.at_xpath('//xmlns:protocolVersion').text).to eql '2.0'
  end

  it "contains earliest datestamp" do
    expect(xml.at_xpath('//xmlns:earliestDatestamp').text).to eql '2014-02-03T18:42:53Z'
  end

  it "contains delete records" do
    expect(xml.at_xpath('//xmlns:deletedRecord').text).to eql 'persistent'
  end

  it "contains granularity" do
    expect(xml.at_xpath('//xmlns:granularity').text).to eql 'YYYY-MM-DDThh:mm:ssZ'
  end

  it "contains admin email" do
    expect(xml.at_xpath('//xmlns:adminEmail').text).to eql 'root@localhost'
  end

  it "contains repository prefix/identifier" do
    expect(
      xml.at_xpath('//oai-identifier:repositoryIdentifier', 'oai-identifier' => "http://www.openarchives.org/OAI/2.0/oai-identifier").text
    ).to eql 'test'
  end

  it "contains sample identifier" do
    expect(
      xml.at_xpath('//oai-identifier:sampleIdentifier', 'oai-identifier' => "http://www.openarchives.org/OAI/2.0/oai-identifier").text
    ).to eql 'oai:test:109660'
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
blacklight_oai_provider-6.1.1 spec/requests/identify_spec.rb
blacklight_oai_provider-6.1.0 spec/requests/identify_spec.rb
blacklight_oai_provider-6.0.0 spec/requests/identify_spec.rb
blacklight_oai_provider-6.0.0.pre2 spec/requests/identify_spec.rb
blacklight_oai_provider-6.0.0.pre1 spec/requests/identify_spec.rb
blacklight_oai_provider-5.1.0 spec/requests/identify_spec.rb
blacklight_oai_provider-5.0.0 spec/requests/identify_spec.rb
blacklight_oai_provider-5.0.0.pre1 spec/requests/identify_spec.rb