Sha256: 5738b3e5c85f5ae215dd92c1324371b8cd5542c28ce2f1ce99908968b9b5ba9a

Contents?: true

Size: 844 Bytes

Versions: 13

Compression:

Stored size: 844 Bytes

Contents

require 'spec_helper'

RSpec.describe Sufia::ResourceSync::SourceDescriptionWriter do
  let(:sitemap) { 'http://www.sitemaps.org/schemas/sitemap/0.9' }
  let(:rs) { 'http://www.openarchives.org/rs/terms/' }

  let(:capability_list) { 'http://example.com/capabilityList.xml' }

  subject { described_class.new(capability_list_url: capability_list).write }
  let(:xml) { Nokogiri::XML.parse(subject) }

  it "has url to the capability list" do
    capability = xml.xpath('/x:urlset/rs:md/@capability', 'x' => sitemap, 'rs' => rs).map(&:value)
    expect(capability).to eq ["description"]

    url = xml.xpath('//x:url[1]/x:loc', 'x' => sitemap).text
    expect(url).to eq capability_list
    capability = xml.xpath('//x:url[1]/rs:md/@capability', 'x' => sitemap, 'rs' => rs).map(&:value)
    expect(capability).to eq ["capabilitylist"]
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sufia-7.4.1 spec/lib/sufia/resource_sync/source_description_writer_spec.rb
sufia-7.4.0 spec/lib/sufia/resource_sync/source_description_writer_spec.rb
sufia-7.3.1 spec/lib/sufia/resource_sync/source_description_writer_spec.rb
sufia-7.3.0 spec/lib/sufia/resource_sync/source_description_writer_spec.rb
sufia-7.3.0.rc3 spec/lib/sufia/resource_sync/source_description_writer_spec.rb
sufia-7.3.0.rc2 spec/lib/sufia/resource_sync/source_description_writer_spec.rb
sufia-7.3.0.rc1 spec/lib/sufia/resource_sync/source_description_writer_spec.rb
sufia-7.2.0 spec/lib/sufia/resource_sync/source_description_writer_spec.rb
sufia-7.1.0 spec/lib/sufia/resource_sync/source_description_writer_spec.rb
sufia-7.0.0 spec/lib/sufia/resource_sync/source_description_writer_spec.rb
sufia-7.0.0.rc2 spec/lib/sufia/resource_sync/source_description_writer_spec.rb
sufia-7.0.0.rc1 spec/lib/sufia/resource_sync/source_description_writer_spec.rb
sufia-7.0.0.beta4 spec/lib/sufia/resource_sync/source_description_writer_spec.rb