tests: fix broken tests.

This commit is contained in:
evazion
2021-12-07 19:28:08 -06:00
parent 08bcd51ac8
commit e57e38b35f
3 changed files with 6 additions and 8 deletions

View File

@@ -171,7 +171,7 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
end
should "show a notice for a single tag search with a pending BUR" do
create(:tag, name: "foo")
create(:post, tag_string: "foo")
create(:bulk_update_request, script: "create alias foo -> bar")
get_auth posts_path(tags: "foo"), @user
assert_select ".tag-change-notice"
@@ -196,7 +196,7 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
get posts_path, params: { tags: "1girl rating:s" }
assert_response :success
assert_select "li.wiki-excerpt-link", count: 1
assert_select "a.wiki-excerpt-link", count: 1
end
should "show the blank wiki excerpt if the search has tag without a wiki" do
@@ -204,7 +204,7 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
get posts_path, params: { tags: "1girl rating:s" }
assert_response :success
assert_select "li.blank-wiki-excerpt-link", count: 1
assert_select "a.blank-wiki-excerpt-link", count: 1
end
should "render an error when searching for too many tags" do

View File

@@ -17,8 +17,7 @@ class RecommendedPostsControllerTest < ActionDispatch::IntegrationTest
should "render" do
get_auth recommended_posts_path(search: { post_id: @post.id }), @user
assert_response :success
assert_select ".recommended-posts"
assert_select ".recommended-posts #post_#{@post.id}"
assert_select ".post-gallery #post_#{@post.id}"
end
end
@@ -31,8 +30,7 @@ class RecommendedPostsControllerTest < ActionDispatch::IntegrationTest
should "render" do
get_auth recommended_posts_path(search: { user_id: @user.id }), @user
assert_response :success
assert_select ".recommended-posts"
assert_select ".recommended-posts #post_#{@post.id}"
assert_select ".post-gallery #post_#{@post.id}"
end
should "not show recommendations for users with private favorites to other users" do

View File

@@ -21,7 +21,7 @@ module Sources
end
should "get the commentary" do
desc = '<p>a mind forever voyaging through strange seas of thought alone <a href="https://pawoo.net/media/9hJzXvwxVl1CezW0ecM" rel="nofollow noopener" target="_blank"><span class="invisible">https://</span><span class="ellipsis">pawoo.net/media/9hJzXvwxVl1Cez</span><span class="invisible">W0ecM</span></a></p>'
desc = '<p>a mind forever voyaging through strange seas of thought alone <a href="https://pawoo.net/media/9hJzXvwxVl1CezW0ecM" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">pawoo.net/media/9hJzXvwxVl1Cez</span><span class="invisible">W0ecM</span></a></p>'
assert_equal(desc, @site.artist_commentary_desc)
end