Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

Commit

Permalink
Normalize download text to "Download file"
Browse files Browse the repository at this point in the history
  • Loading branch information
mcritchlow committed Jul 15, 2019
1 parent ed3ef16 commit 639b884
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions app/views/dams_objects/_admin_download.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
embed_url = (defined?(embedURL)) ? "#{embedURL}" : nil
etc_menu_item_class = 'pull-right'
embed_glyph = '<i class="glyphicon glyphicon-share-alt"></i> Embed'.html_safe
adl_glyph = '<i class="glyphicon glyphicon-download-alt"></i> Download File'.html_safe
adl_glyph = '<i class="glyphicon glyphicon-download-alt"></i> Download file'.html_safe
file_format = (defined?(format)) ? "#{format.capitalize}" : ''
embed_width = (format == 'audio') ? '629' : '560'
embed_height = (format == 'audio') ? '46' : '315'
Expand All @@ -22,12 +22,12 @@
<%= link_to embed_glyph, "#embedLink-#{component_id}", class:etc_menu_item_class, role:'button', :data => { :toggle => 'modal' }, title:'Embed' %>
<% if can? :update, @document then %>
<%= link_to adl_glyph, downloadFilePath, :rel => 'nofollow', class:etc_menu_item_class, title:'Download File' %>
<%= link_to adl_glyph, downloadFilePath, :rel => 'nofollow', class:etc_menu_item_class, title:'Download file' %>
<% elsif can?(:read, @document) && can_download?(@document) && !downloadDerivativePath.nil?%>
<%= link_to adl_glyph, downloadDerivativePath, :rel => 'nofollow', class:etc_menu_item_class, title:'Download File' %>
<%= link_to adl_glyph, downloadDerivativePath, :rel => 'nofollow', class:etc_menu_item_class, title:'Download file' %>
<% end %>
</div>

<!-- BEGIN_EMBED_MODAL -->
<div id="embedLink-<%=component_id%>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="embedLinkLabel" aria-hidden="true">
<div class="modal-header">
Expand Down
6 changes: 3 additions & 3 deletions spec/features/dams_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,7 @@
end
end

describe "vrr user who has authorized works should not see Download File and Embed button" do
describe "vrr user who has authorized works should not see Download file and Embed button" do
let!(:user) { create_auth_link_user }

before(:all) do
Expand All @@ -1747,13 +1747,13 @@
@pdfObj.delete
end

scenario "the admin_download viewer should not show Download File and Embed button" do
scenario "the admin_download viewer should not show Download file and Embed button" do
user.work_authorizations.create(work_title: 'vrr_test', work_pid: @imgObj.pid)

visit new_user_session_path(email: user.email, auth_token: user.authentication_token)
click_link "View"

expect(page).not_to have_text("Download File")
expect(page).not_to have_text("Download file")
expect(page).not_to have_text("Embed")
end

Expand Down
18 changes: 9 additions & 9 deletions spec/features/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'cancan'


feature "Derivative download" do
feature "Derivative download" do
before(:all) do
@unit = DamsUnit.create pid: 'xx48484848', name: "Test Unit", description: "Test Description",
code: "tu", uri: "http://example.com/"
Expand Down Expand Up @@ -77,8 +77,8 @@
scenario 'should have rel=nofollow for the download link' do
sign_in_developer
visit dams_object_path @obj2
expect(page).to have_css('a[title="Download File"][rel="nofollow"]')
end
expect(page).to have_css('a[title="Download file"][rel="nofollow"]')
end
end

describe "Download more than one master file" do
Expand All @@ -88,7 +88,7 @@
@newspaper = DamsObject.create(pid: "xx21171293")
@newspaper.damsMetadata.content = File.new('spec/fixtures/damsObjectNewspaper.rdf.xml').read
@newspaper.save!
solr_index (@newspaper.pid)
solr_index (@newspaper.pid)
end
after do
@newspaper.delete
Expand All @@ -97,11 +97,11 @@
visit dams_object_path(@newspaper.pid)
expect(page).to have_link('', href:"/object/xx21171293/_1.pdf/download")
expect(page).to_not have_link('', href:"/object/xx21171293/_2.tgz/download")

sign_in_developer
visit dams_object_path(@newspaper.pid)
expect(page).to have_link('', href:"/object/xx21171293/_1.pdf/download?access=curator")
expect(page).to have_link('', href:"/object/xx21171293/_2.tgz/download?access=curator")
expect(page).to have_link('', href:"/object/xx21171293/_2.tgz/download?access=curator")
end
end

Expand All @@ -122,7 +122,7 @@
it "should show a download button" do
sign_in_developer
visit dams_object_path @complexObj.pid
expect(page).to have_link('', href:"/object/#{@complexObj.pid}/_1_2.jpg/download?access=curator")
expect(page).to have_link('', href:"/object/#{@complexObj.pid}/_1_2.jpg/download?access=curator")
end
end

Expand All @@ -145,6 +145,6 @@
sign_in_developer
visit dams_object_path @complexObjPdf.pid
expect(page).to have_link('', href:"/object/#{@complexObjPdf.pid}/_1_1.pdf/download?access=curator")
expect(page).to have_link('', href:"/object/#{@complexObjPdf.pid}/_1_2.mov/download?access=curator")
expect(page).to have_link('', href:"/object/#{@complexObjPdf.pid}/_1_2.mov/download?access=curator")
end
end
end

0 comments on commit 639b884

Please sign in to comment.