Sha256: da396d17a8a2ba757bdc9d515c254e3e454ca3a9d9cffc35738404713ca693e2

Contents?: true

Size: 1.16 KB

Versions: 21

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe Hydra::Works::MimeTypes do
  subject { Hydra::Works::FileSet.new }

  describe '#pdf?' do
    before do
      allow(subject).to receive(:mime_type).and_return('application/pdf')
    end
    it 'is true' do
      expect(subject.pdf?).to be true
    end
  end

  describe '#image?' do
    before do
      allow(subject).to receive(:mime_type).and_return('image/jpeg')
    end
    it 'is true' do
      expect(subject.image?).to be true
    end
  end

  describe '#video?' do
    before do
      allow(subject).to receive(:mime_type).and_return('video/mp4')
    end
    it 'is true' do
      expect(subject.video?).to be true
    end
  end

  describe '#audio?' do
    before do
      allow(subject).to receive(:mime_type).and_return('audio/mp3')
    end
    it 'is true' do
      expect(subject.audio?).to be true
    end
  end

  describe '#office_document?' do
    before do
      allow(subject).to receive(:mime_type).and_return('application/msword')
    end
    it 'is true' do
      expect(subject.office_document?).to be true
    end
  end

  describe '#collection?' do
    it 'is false' do
      expect(subject.collection?).to be false
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
hydra-works-2.2.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-2.1.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-2.0.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-1.2.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-1.1.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-1.0.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.17.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.16.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.15.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.12.1 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.14.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.13.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.12.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.11.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.10.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.9.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.8.1 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.8 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.7.1 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb
hydra-works-0.7.0 spec/hydra/works/models/concerns/file_set/mime_types_spec.rb