Skip to content

Commit

Permalink
Single Use Link view should use the title from the presenter
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Nov 23, 2015
1 parent e351cea commit f29ab91
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div >
<h1 class="lower"><%= @asset %></h1>
<h1 class="lower"><%= @presenter %></h1>
<h2 class="non lower">Actions</h2>
<p>
<%= link_to "Download (can only be used once)", @download_link, target: '_blank', data: { 'no-turbolink' => ''} %>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'spec_helper'

describe 'curation_concerns/single_use_links_viewer/show.html.erb' do
let(:ability) { double }
let(:model) { stub_model(FileSet, title: ['world.png']) }
let(:solr_document) { SolrDocument.new(model.to_solr) }
let(:presenter) { CurationConcerns::FileSetPresenter.new(solr_document, ability) }
let(:download_link) { '/a_path' }
before do
assign(:presenter, presenter)
assign(:download_link, download_link)
view.lookup_context.view_paths.push 'app/views/curation_concerns/base'
render
end

it "renders the page" do
expect(rendered).to have_selector 'h1', text: 'world.png'
end
end

0 comments on commit f29ab91

Please sign in to comment.