Fix #4507: Clicking "View wiki" on Artists with no wiki redirects to the posts page.
This commit is contained in:
@@ -16,8 +16,10 @@
|
|||||||
<%= render "tag_relationships/alias_and_implication_list", tag: artist.tag %>
|
<%= render "tag_relationships/alias_and_implication_list", tag: artist.tag %>
|
||||||
|
|
||||||
<p class="links">
|
<p class="links">
|
||||||
<%= link_to "View wiki", artist.wiki_page %> |
|
<% if artist.wiki_page.present? %>
|
||||||
<%= link_to "View artist", artist_path(artist.id) %>
|
<%= link_to "View wiki", artist.wiki_page, id: "view-wiki-link" %> |
|
||||||
|
<% end %>
|
||||||
|
<%= link_to "View artist", artist, id: "view-artist-link" %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -32,7 +34,7 @@
|
|||||||
<%= render "tag_relationships/alias_and_implication_list", tag: wiki_page.tag %>
|
<%= render "tag_relationships/alias_and_implication_list", tag: wiki_page.tag %>
|
||||||
|
|
||||||
<p class="links">
|
<p class="links">
|
||||||
<%= link_to_wiki "View wiki", wiki_page.title %>
|
<%= link_to_wiki "View wiki", wiki_page.title, id: "view-wiki-link" %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
|
|||||||
get posts_path, params: { tags: "bkub" }
|
get posts_path, params: { tags: "bkub" }
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_select "#show-excerpt-link", count: 1, text: "Artist"
|
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)
|
artist.update(is_banned: true)
|
||||||
get posts_path, params: { tags: "bkub" }
|
get posts_path, params: { tags: "bkub" }
|
||||||
@@ -49,6 +51,8 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
|
|||||||
get posts_path, params: { tags: "bkub" }
|
get posts_path, params: { tags: "bkub" }
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_select "#show-excerpt-link", count: 1, text: "Wiki"
|
assert_select "#show-excerpt-link", count: 1, text: "Wiki"
|
||||||
|
assert_select "#view-wiki-link", count: 1
|
||||||
|
assert_select "#view-artist-link", count: 0
|
||||||
end
|
end
|
||||||
|
|
||||||
should "render for a tag with a wiki page" do
|
should "render for a tag with a wiki page" do
|
||||||
|
|||||||
Reference in New Issue
Block a user