Sha256: 7b75923af9f4a92f2323f05f07bb6be674ca75a49d0f0d2a6288bc9b07d0b281

Contents?: true

Size: 1.01 KB

Versions: 10

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

describe 'hyrax/single_use_links_viewer/show.html.erb' do
  let(:f) do
    file = FileSet.create do |gf|
      gf.apply_depositor_metadata('jill')
    end
    Hydra::Works::AddFileToFileSet.call(file, File.open(fixture_path + '/world.png'), :original_file)
    file
  end

  let(:solr_document) { SolrDocument.new(has_model_ssim: ['FileSet']) }
  let(:ability) { double }

  let(:hash) { "some-dummy-sha2-hash" }

  before do
    assign :asset, f
    assign :download_link, Hyrax::Engine.routes.url_helpers.download_single_use_link_path(hash)
    assign :presenter, Hyrax::FileSetPresenter.new(solr_document, ability)
    view.lookup_context.view_paths.push "#{Hyrax::Engine.root}/app/views/hyrax/base"
    render
  end

  it "contains a download link" do
    expect(rendered).to have_selector "a[href^='/single_use_link/download/']"
  end

  it "has turbolinks disabled in the download link" do
    expect(rendered).to have_selector "a[data-turbolinks^='false'][href^='/single_use_link/download/']"
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb
hyrax-1.1.0 spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb
hyrax-1.0.5 spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb
hyrax-1.0.4 spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb
hyrax-1.0.3 spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb
hyrax-1.0.2 spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb
hyrax-1.0.1 spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb
hyrax-1.0.0.rc2 spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb
hyrax-1.0.0.rc1 spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb
test_hyrax-0.0.1.alpha spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb