diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index e1dc27c1d..dac55e547 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -22,7 +22,10 @@ <% if @user.super_admin? %> <% elsif @user.curator? %> -

Curator for: <%= @user.admin_collections.map(&:title).to_sentence %>

+

Curator for: + <%= @user.admin_collections.map do |collection| + link_to(collection.title, collection_path(collection)) + end.to_sentence.html_safe %>

<% end %> <% if @my_dashboard %> diff --git a/spec/system/user_show_spec.rb b/spec/system/user_show_spec.rb index 6413f6640..1d14d6c84 100644 --- a/spec/system/user_show_spec.rb +++ b/spec/system/user_show_spec.rb @@ -4,6 +4,7 @@ describe "Sort by last edited uses the proper value" do let(:user_admin) { FactoryBot.create :super_admin_user } let(:work) { FactoryBot.create(:draft_work) } + let(:moderator_user) { FactoryBot.create :pppl_moderator } it "renders the proper date value for sorting by last edited", js: true do work_last_edited = work.updated_at.strftime("%Y-%m-%d %H:%M:%S %Z") @@ -12,5 +13,13 @@ visit user_path(user_admin) expect(page.html.include?(sort_value)).to be true end + + it "renders the collection names as links", js: true do + sign_in moderator_user + visit user_path(moderator_user) + pppl_url = collection_path(Collection.plasma_laboratory) + expected_link = "#{Collection.plasma_laboratory.title}" + expect(page.html.include?(expected_link)).to be true + end end end