Sha256: 53fc09fb22e51f12fc4e29a66de3eb8e794791f05e0e9c9baf7370269ff2dd0a
Contents?: true
Size: 1.67 KB
Versions: 3
Compression:
Stored size: 1.67 KB
Contents
require 'spec_helper' RSpec.describe GeoConcerns::RasterWorkShowPresenter do let(:solr_document) { SolrDocument.new(attributes) } let(:ability) { nil } describe "delegated methods" do let(:attributes) { { "mime_type_ssi" => ['image/tiff; gdal-format=GTiff'] } } subject { described_class.new(solr_document, ability) } describe "#first" do it "delegates to solr document" do expect(subject.first('mime_type_ssi')).to eq('image/tiff; gdal-format=GTiff') end end describe "#has?" do it "delegates to solr document" do expect(subject.has?('mime_type_ssi')).to be_truthy end end end describe "#vector_work_presenters" do let(:obj) { FactoryGirl.create(:raster_work_with_vector_works) } let(:attributes) { obj.to_solr } subject { described_class.new(solr_document, ability) } it "returns vector work presenters" do expect(subject.vector_work_presenters.count).to eq 2 expect(subject.vector_work_presenters.first.first('has_model_ssim')).to eq "VectorWork" end end describe "file presenters" do let(:obj) { FactoryGirl.create(:raster_work_with_files_and_metadata_files) } let(:attributes) { obj.to_solr } subject { described_class.new(solr_document, ability) } describe "#raster_file_presenters" do it "returns only raster_file_presenters file presenters" do expect(subject.raster_file_presenters.count).to eq 2 end end describe "#external_metadata_file_formats_presenters" do it "returns only external_metadata_file_formats_presenters" do expect(subject.external_metadata_file_formats_presenters.count).to eq 2 end end end end
Version data entries
3 entries across 3 versions & 1 rubygems