Sha256: 9adca48cd7d0456406493e983756f3eae1aa6aeaf8c52e7eae0703a13831e6cb

Contents?: true

Size: 931 Bytes

Versions: 4

Compression:

Stored size: 931 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'

describe Geoblacklight::GeojsonDownload do
  let(:document) { SolrDocument.new(Settings.FIELDS.ID => '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 GeojsonDownload 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/json'
      expect(options[:request_params][:typeName]).to eq 'stanford-test'
    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 spec/lib/geoblacklight/download/geojson_download_spec.rb
geoblacklight-4.0.0.pre.rc3 spec/lib/geoblacklight/download/geojson_download_spec.rb
geoblacklight-4.0.0.pre.rc2 spec/lib/geoblacklight/download/geojson_download_spec.rb
geoblacklight-4.0.0.pre.rc1 spec/lib/geoblacklight/download/geojson_download_spec.rb