Sha256: f34420a1874653a5d499cd5d480cb5d3162b11f7478667cdd218c6b2849b8b8d

Contents?: true

Size: 950 Bytes

Versions: 4

Compression:

Stored size: 950 Bytes

Contents

require 'spec_helper.rb'

describe 'curation_concern/generic_files/_media_display.html.erb' do
  describe 'with an image file' do
    it 'displays the image' do
      img = stub_model(GenericFile, image?: true, pid: 'curate:testfoo')

      render(partial: 'media_display', locals: {generic_file: img})

      expect(rendered).to include(download_path(img))
    end
  end

  describe 'with an audio file' do
    it 'displays an audio player' do
      audio_file = stub_model(GenericFile, audio?: true, pid: 'curate:testfoo')

      render(partial: 'media_display', locals: {generic_file: audio_file})

      expect(rendered).to include('audio')
    end
  end

  describe 'with an unknown file' do
    it 'displays a placeholder image' do
      unknown_file = stub_model(GenericFile, pid: 'curate:testfoo')

      render(partial: 'media_display', locals: {generic_file: unknown_file})

      expect(rendered).to include('nope.png')
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
curate-0.6.6 spec/views/curation_concern/generic_files/_media_display.html.erb_spec.rb
curate-0.6.5 spec/views/curation_concern/generic_files/_media_display.html.erb_spec.rb
curate-0.6.4 spec/views/curation_concern/generic_files/_media_display.html.erb_spec.rb
curate-0.6.3 spec/views/curation_concern/generic_files/_media_display.html.erb_spec.rb