artists: show "Artist" tab in searches for artists without artist entry.

On the post index page, show the "Artist" tab instead of the "Wiki" tab when searching for
an artist tag that doesn't have an artist entry. This way the user is prompted to create a
new artist entry instead of a new wiki.
This commit is contained in:
evazion
2022-02-09 01:10:35 -06:00
parent d4b251a079
commit 26d54c1e37
2 changed files with 11 additions and 5 deletions

View File

@@ -93,7 +93,7 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
create(:post, tag_string: "artist:bkub", rating: "s")
get posts_path, params: { tags: "bkub" }
assert_response :success
assert_select "#show-excerpt-link", count: 1, text: "Wiki"
assert_select "#show-excerpt-link", count: 1, text: "Artist"
artist = create(:artist, name: "bkub")
get posts_path, params: { tags: "bkub" }
@@ -110,13 +110,13 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
artist.update(is_banned: false, is_deleted: true)
get posts_path, params: { tags: "bkub" }
assert_response :success
assert_select "#show-excerpt-link", count: 1, text: "Wiki"
assert_select "#show-excerpt-link", count: 1, text: "Artist"
as(@user) { create(:wiki_page, title: "bkub") }
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 "#show-excerpt-link", count: 1, text: "Artist"
assert_select "#view-wiki-link", count: 0
assert_select "#view-artist-link", count: 0
end