1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-02-01 03:57:15 +00:00

Fix "missing assertions" warning in test_search_should_be_case_and_accent_insensitive_with_postgresql_and_noaccent_extension (#36320).

git-svn-id: https://svn.redmine.org/redmine/trunk@22969 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2024-08-20 09:09:59 +00:00
parent e2daacfa34
commit 7545c82fd3

View File

@ -195,18 +195,18 @@ class SearchTest < ActiveSupport::TestCase
end
def test_search_should_be_case_and_accent_insensitive_with_postgresql_and_noaccent_extension
if postgresql?
skip unless Redmine::Database.postgresql_version >= 90000
# Extension will be rollbacked with the test transaction
ActiveRecord::Base.connection.execute("CREATE EXTENSION IF NOT EXISTS unaccent")
Redmine::Database.reset
assert Redmine::Database.postgresql_unaccent?
issue1 = Issue.generate!(:subject => "OO")
issue2 = Issue.generate!(:subject => "oo")
r = Issue.search_results('ÖÖ')
assert_include issue1, r
assert_include issue2, r
end
skip unless postgresql?
skip unless Redmine::Database.postgresql_version >= 90000
# Extension will be rollbacked with the test transaction
ActiveRecord::Base.connection.execute("CREATE EXTENSION IF NOT EXISTS unaccent")
Redmine::Database.reset
assert Redmine::Database.postgresql_unaccent?
issue1 = Issue.generate!(:subject => "OO")
issue2 = Issue.generate!(:subject => "oo")
r = Issue.search_results('ÖÖ')
assert_include issue1, r
assert_include issue2, r
ensure
Redmine::Database.reset
end