Sha256: e74a58af93bd2479b7feab13a8a2224f3de53f14bef74b128e031db3f0fea162

Contents?: true

Size: 933 Bytes

Versions: 4

Compression:

Stored size: 933 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'

describe Geoblacklight::GeotiffDownload do
  let(:document) { SolrDocument.new(Settings.FIELDS.ID => 'test', Settings.FIELDS.WXS_IDENTIFIER => 'stanford-test', Settings.FIELDS.SPATIAL_EXTENT => 'ENVELOPE(-180, 180, 90, -90)') }
  let(:download) { described_class.new(document) }
  describe '#initialize' do
    it 'initializes as a GeotiffDownload object with specific options' do
      expect(download).to be_an described_class
      options = download.instance_variable_get(:@options)
      expect(options[:content_type]).to eq 'image/geotiff'
      expect(options[:request_params][:layers]).to eq 'stanford-test'
      expect(options[:reflect]).to be_truthy
    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

4 entries across 4 versions & 1 rubygems

Version Path
geoblacklight-4.0.0.pre.alpha.3 spec/lib/geoblacklight/download/geotiff_download_spec.rb
geoblacklight-4.0.0.pre.alpha.2 spec/lib/geoblacklight/download/geotiff_download_spec.rb
geoblacklight-4.0.0.pre.alpha.1 spec/lib/geoblacklight/download/geotiff_download_spec.rb
geoblacklight-4.0.0.pre.alpha spec/lib/geoblacklight/download/geotiff_download_spec.rb