Sha256: 27ede9a12d8785d226c529df0b6e27723586939e39ba1c3aa1cdabddfaaba5cd

Contents?: true

Size: 738 Bytes

Versions: 1

Compression:

Stored size: 738 Bytes

Contents

require 'spec_helper'
require 'maltese/cli'

describe Maltese::CLI do
  let(:subject) do
    described_class.new
  end

  let(:sitemap_bucket) { "search.test.datacite.org" }
  let(:cli_options) { { sitemap_bucket: sitemap_bucket } }

  describe "sitemap", vcr: true, :order => :defined do
    it 'should succeed' do
      subject.options = cli_options
      expect { subject.sitemap }.to output(/10001 links/).to_stdout
      sitemap = Zlib::GzipReader.open("public/sitemaps/sitemap.xml.gz") { |gz| gz.read }
      doc = Nokogiri::XML(sitemap)
      expect(doc.xpath("//xmlns:url").size).to eq(10001)
      expect(doc.xpath("//xmlns:loc").last.text).to eq("https://search.test.datacite.org/works/10.0133/1519753351949")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
maltese-0.8.4 spec/cli_spec.rb