Sha256: c89d9b3eaf5eb68fe297bb13b0267852d94aa1b47428bd63af0f284dbaaadb0b

Contents?: true

Size: 802 Bytes

Versions: 8

Compression:

Stored size: 802 Bytes

Contents

require 'spec_helper'

describe 'curation_concerns/file_sets/mdeia_display/_default.html.erb', type: :view do
  let(:file_set) { stub_model(FileSet) }
  let(:config) { double }
  let(:link) { true }

  before do
    allow(CurationConcerns.config).to receive(:display_media_download_link).and_return(link)
    render 'curation_concerns/file_sets/media_display/default', file_set: file_set
  end

  it "draws the view with the link" do
    expect(rendered).to have_css('div.no-preview')
    expect(rendered).to have_css('a', text: 'Download the file')
  end

  context "no download links" do
    let(:link) { false }

    it "draws the view without the link" do
      expect(rendered).to have_css('div.no-preview')
      expect(rendered).not_to have_css('a', text: 'Download the file')
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sufia-7.4.1 spec/views/curation_concerns/file_sets/media_display/_default.html.erb_spec.rb
sufia-7.4.0 spec/views/curation_concerns/file_sets/media_display/_default.html.erb_spec.rb
sufia-7.3.1 spec/views/curation_concerns/file_sets/media_display/_default.html.erb_spec.rb
sufia-7.3.0 spec/views/curation_concerns/file_sets/media_display/_default.html.erb_spec.rb
sufia-7.3.0.rc3 spec/views/curation_concerns/file_sets/media_display/_default.html.erb_spec.rb
sufia-7.3.0.rc2 spec/views/curation_concerns/file_sets/media_display/_default.html.erb_spec.rb
sufia-7.3.0.rc1 spec/views/curation_concerns/file_sets/media_display/_default.html.erb_spec.rb
sufia-7.2.0 spec/views/curation_concerns/file_sets/media_display/_default.html.erb_spec.rb