Sha256: 57274a3e59885fc7bb0d754cdad2a546f3d644ad7e77fab4c59102394cbc1d3b

Contents?: true

Size: 953 Bytes

Versions: 15

Compression:

Stored size: 953 Bytes

Contents

require 'spec_helper'

describe GeoConcerns::Actors::FileActor do
  include ActionDispatch::TestProcess
  let(:user) { double }
  let(:file) { double }
  let(:file_set) { double }
  let(:actor) { described_class.new(file_set, 'test', user) }

  describe '#mime_type' do
    context 'there is a mime_type attribute on the file set' do
      it 'returns the file set mime type' do
        allow(file_set).to receive(:geo_mime_type).and_return('text/plain; gdal-format=USGSDEM')
        expect(actor.mime_type(file)).to eq('text/plain; gdal-format=USGSDEM')
      end
    end

    context 'there is not a mime_type attribute on the file set' do
      it 'returns the file set mime type' do
        allow(file_set).to receive(:geo_mime_type).and_return(nil)
        allow(file).to receive(:content_type).and_return('text/plain; gdal-format=USGSDEM')
        expect(actor.mime_type(file)).to eq('text/plain; gdal-format=USGSDEM')
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
geo_concerns-0.3.4 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.3.3 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.3.2 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.3.1 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.3.0 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.2.0 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.1.1 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.1.0 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.0.10 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.0.9 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.0.8 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.0.7 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.0.6 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.0.5 spec/actors/geo_concerns/actors/file_actor_spec.rb
geo_concerns-0.0.4 spec/actors/geo_concerns/actors/file_actor_spec.rb