Sha256: 98367daa2fbef99128e4ad10679af224889d75b68ad724298ab67b951951f0d6

Contents?: true

Size: 1.37 KB

Versions: 18

Compression:

Stored size: 1.37 KB

Contents

require 'spec_helper'

describe FileSet do
  let(:user) { create(:user) }
  subject { described_class.new(geo_mime_type: 'image/tiff; gdal-format=GTiff') }

  context "when geo_mime_type is a raster format" do
    it "responds as a raster file" do
      expect(subject.raster_file?).to be_truthy
    end
    it "doesn't respond as a vector file" do
      expect(subject.vector_file?).to be_falsey
    end
  end

  describe 'raster work association' do
    let(:work) { FactoryGirl.create(:raster_work_with_one_file) }
    subject { work.file_sets.first.reload }
    it 'belongs to raster work' do
      expect(subject.raster_work).to match_array [work]
    end
  end

  describe "to_solr" do
    let(:solr_doc) { FactoryGirl.build(:vector_file,
                                       date_uploaded: Time.zone.today,
                                       cartographic_projection: 'urn:ogc:def:crs:EPSG::6326').to_solr
    }

    it "indexes the coordinate reference system" do
      expect(solr_doc.keys).to include 'cartographic_projection_tesim'
    end
  end

  describe 'metadata' do
    it 'has descriptive metadata' do
      expect(subject).to respond_to(:title)
    end

    it 'has an authoritative cartographic projection' do
      expect(subject).to respond_to(:cartographic_projection)
    end

    it 'has standard' do
      expect(subject).to respond_to(:geo_mime_type)
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
geo_works-0.2.0 spec/models/raster_file_spec.rb
geo_works-0.1.4 spec/models/raster_file_spec.rb
geo_works-0.1.3 spec/models/raster_file_spec.rb
geo_works-0.1.2 spec/models/raster_file_spec.rb
geo_works-0.1.1 spec/models/raster_file_spec.rb
geo_works-0.1.0 spec/models/raster_file_spec.rb
geo_concerns-0.3.4 spec/models/raster_file_spec.rb
geo_concerns-0.3.3 spec/models/raster_file_spec.rb
geo_concerns-0.3.2 spec/models/raster_file_spec.rb
geo_concerns-0.3.1 spec/models/raster_file_spec.rb
geo_concerns-0.3.0 spec/models/raster_file_spec.rb
geo_concerns-0.2.0 spec/models/raster_file_spec.rb
geo_concerns-0.1.1 spec/models/raster_file_spec.rb
geo_concerns-0.1.0 spec/models/raster_file_spec.rb
geo_concerns-0.0.10 spec/models/raster_file_spec.rb
geo_concerns-0.0.9 spec/models/raster_file_spec.rb
geo_concerns-0.0.8 spec/models/raster_file_spec.rb
geo_concerns-0.0.7 spec/models/raster_file_spec.rb