From 6c5dd5ffedafec0c2de5c9c30c2b8998e500ee9c Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 18 Apr 2022 00:31:31 -0500 Subject: [PATCH] tests: fix broken tests. --- test/functional/application_controller_test.rb | 2 +- test/unit/bulk_update_request_test.rb | 2 ++ test/unit/post_query_builder_test.rb | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index e9b49d302..c4c935f66 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -238,7 +238,7 @@ class ApplicationControllerTest < ActionDispatch::IntegrationTest # try to submit a form with cookies but without the csrf token put user_path(@user), headers: { HTTP_COOKIE: headers["Set-Cookie"] }, params: { user: { enable_safe_mode: "true" } } assert_response 403 - assert_equal("Can't verify CSRF token authenticity.", css_select("p").first.content) + assert_equal("Error: Can't verify CSRF token authenticity.", css_select("p").first.content) assert_equal(false, @user.reload.enable_safe_mode) end end diff --git a/test/unit/bulk_update_request_test.rb b/test/unit/bulk_update_request_test.rb index 037e50170..13ba17b6b 100644 --- a/test/unit/bulk_update_request_test.rb +++ b/test/unit/bulk_update_request_test.rb @@ -571,7 +571,9 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase end should "not work for tags without a wiki page" do + create(:tag, name: "no_wiki") @bur = build(:bulk_update_request, script: "deprecate no_wiki") + assert_equal(false, @bur.valid?) assert_equal(["Can't deprecate no_wiki (tag must have a wiki page)"], @bur.errors[:base]) end diff --git a/test/unit/post_query_builder_test.rb b/test/unit/post_query_builder_test.rb index 62362aaac..1fa78f579 100644 --- a/test/unit/post_query_builder_test.rb +++ b/test/unit/post_query_builder_test.rb @@ -1,8 +1,8 @@ require 'test_helper' class PostQueryBuilderTest < ActiveSupport::TestCase - def assert_tag_match(posts, query, current_user: CurrentUser.user, **options) - assert_equal(posts.map(&:id), Post.user_tag_match(query, current_user, **options).pluck(:id)) + def assert_tag_match(posts, query, current_user: CurrentUser.user, tag_limit: nil, **options) + assert_equal(posts.map(&:id), Post.user_tag_match(query, current_user, tag_limit: tag_limit, **options).pluck(:id)) end def assert_search_error(query, current_user: CurrentUser.user, **options)