Skip to content

Commit

Permalink
Merge pull request #420 from pulibrary/restricted-message-fix
Browse files Browse the repository at this point in the history
Only shows restricted message when not logged in
  • Loading branch information
christinach authored Aug 9, 2024
2 parents 39ba65a + 19dcea6 commit 54408d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/views/shared/_restricted_message.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<% if current_user.nil? || current_user.guest %>
<div class="alert alert--warning" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="click to close" role="button">
<span aria-hidden="true">×</span>
</button>
<p>Access to these data files is restricted to currently enrolled/employed members of Princeton University</p>
</div>
<% end %>
5 changes: 5 additions & 0 deletions spec/views/data_files/index.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
])
end

it 'does not show alert banner when logged in' do
render
assert_select 'p', count: 0, text: 'Access to these data files is restricted to currently enrolled/employed members of Princeton University'
end

it 'renders a list of data_files' do
render

Expand Down

0 comments on commit 54408d6

Please sign in to comment.