From f06e322dc0d86a7e12be65004b165928430fc65a Mon Sep 17 00:00:00 2001 From: evazion Date: Sat, 27 Jun 2020 01:20:05 -0500 Subject: [PATCH] Fix #4507: Clicking "View wiki" on Artists with no wiki redirects to the posts page. --- app/views/posts/partials/index/_excerpt.html.erb | 8 +++++--- test/functional/posts_controller_test.rb | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/posts/partials/index/_excerpt.html.erb b/app/views/posts/partials/index/_excerpt.html.erb index bda961e4b..89d5636e4 100644 --- a/app/views/posts/partials/index/_excerpt.html.erb +++ b/app/views/posts/partials/index/_excerpt.html.erb @@ -16,8 +16,10 @@ <%= render "tag_relationships/alias_and_implication_list", tag: artist.tag %> <% end %> @@ -32,7 +34,7 @@ <%= render "tag_relationships/alias_and_implication_list", tag: wiki_page.tag %> <% end %> diff --git a/test/functional/posts_controller_test.rb b/test/functional/posts_controller_test.rb index 548ecacab..173798edd 100644 --- a/test/functional/posts_controller_test.rb +++ b/test/functional/posts_controller_test.rb @@ -34,6 +34,8 @@ class PostsControllerTest < ActionDispatch::IntegrationTest get posts_path, params: { tags: "bkub" } assert_response :success assert_select "#show-excerpt-link", count: 1, text: "Artist" + assert_select "#view-wiki-link", count: 0 + assert_select "#view-artist-link", count: 1 artist.update(is_banned: true) get posts_path, params: { tags: "bkub" } @@ -49,6 +51,8 @@ class PostsControllerTest < ActionDispatch::IntegrationTest get posts_path, params: { tags: "bkub" } assert_response :success assert_select "#show-excerpt-link", count: 1, text: "Wiki" + assert_select "#view-wiki-link", count: 1 + assert_select "#view-artist-link", count: 0 end should "render for a tag with a wiki page" do