Sha256: 3fb28dd966d1166d325dc57adc3c3357cd060176535d1d07c8d1f55151f20fc0

Contents?: true

Size: 1 KB

Versions: 8

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true
require 'spec_helper'

describe Geoblacklight::KmzDownload do
  let(:document) { SolrDocument.new(Settings.FIELDS.UNIQUE_KEY => 'test', solr_wfs_url: 'http://www.example.com/wfs', Settings.FIELDS.WXS_IDENTIFIER => 'stanford-test', Settings.FIELDS.GEOMETRY => 'ENVELOPE(-180, 180, 90, -90)') }
  let(:download) { described_class.new(document) }
  describe '#initialize' do
    it 'initializes as a KmzDownload object with specific options' do
      expect(download).to be_an described_class
      options = download.instance_variable_get(:@options)
      expect(options[:content_type]).to eq 'application/vnd.google-earth.kmz'
      expect(options[:request_params][:layers]).to eq 'stanford-test'
      expect(options[:request_params][:bbox]).to eq '-180.0, -90.0, 180.0, 90.0'
    end
    it 'merges custom options' do
      download = described_class.new(document, timeout: 33)
      options = download.instance_variable_get(:@options)
      expect(options[:timeout]).to eq 33
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
geoblacklight-3.8.1 spec/lib/geoblacklight/download/kmz_download_spec.rb
geoblacklight-3.8.0 spec/lib/geoblacklight/download/kmz_download_spec.rb
geoblacklight-3.7.0 spec/lib/geoblacklight/download/kmz_download_spec.rb
geoblacklight-3.6.0 spec/lib/geoblacklight/download/kmz_download_spec.rb
geoblacklight-3.5.0 spec/lib/geoblacklight/download/kmz_download_spec.rb
geoblacklight-3.4.0 spec/lib/geoblacklight/download/kmz_download_spec.rb
geoblacklight-3.3.1 spec/lib/geoblacklight/download/kmz_download_spec.rb
geoblacklight-3.3.0 spec/lib/geoblacklight/download/kmz_download_spec.rb