From b4a703ce4ea166d855d8e467e0b95a962d762a01 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sat, 7 Apr 2018 06:39:57 +0000 Subject: Support for lastnames with spaces in user autocompleters (#28154). Patch by Gregor Schmidt. git-svn-id: http://svn.redmine.org/redmine/trunk@17259 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/principal_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/unit/principal_test.rb b/test/unit/principal_test.rb index 2abd110f9..bb03a088e 100644 --- a/test/unit/principal_test.rb +++ b/test/unit/principal_test.rb @@ -127,6 +127,16 @@ class PrincipalTest < ActiveSupport::TestCase assert_equal User.find(2), results.first end + test "like scope should find lastname with spaces" do + user = User.find(1) + user.update_columns(:firstname => 'Leonardo', :lastname => 'da Vinci') + + results = Principal.like('Leonardo da Vinci') + + assert_equal 1, results.count + assert_equal user, results.first + end + def test_like_scope_with_cyrillic_name user = User.generate!(:firstname => 'Соболев', :lastname => 'Денис') results = Principal.like('Собо') -- cgit v1.2.3