This commit is contained in:
Martin 2025-08-10 02:07:12 +00:00 committed by GitHub
commit 988b7c2436
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 2 deletions

View file

@ -4,7 +4,6 @@ class PartialSearchFormatter
search_params.each do |key, value| search_params.each do |key, value|
next unless should_format?(key, value) next unless should_format?(key, value)
search_params[key] = format_value(value) search_params[key] = format_value(value)
end end

View file

@ -0,0 +1,26 @@
require 'test_helper'
class Admin::DomainsControllerTest < ApplicationIntegrationTest
setup do
sign_in users(:admin)
@john = contacts(:john)
@john.update!(ident: '1234-1234') # ident with hyphen
registrant = @john.becomes(Registrant)
@domain = domains(:shop)
@domain.update!(registrant: registrant) # make sure the domain is linked to registrant
end
def test_search_by_hyphenated_registrant_ident_should_succeed
get admin_domains_path, params: { q: { registrant_ident_matches: '1234-1234' } }
assert_response :success
assert_includes @response.body, @domain.name,
"Search should find domain when searching by hyphenated registrant ident"
end
def test_search_by_hyphenated_contact_ident_should_succeed
get admin_domains_path, params: { q: { contacts_ident_matches: '1234-1234' } }
assert_response :success
assert_includes @response.body, @domain.name,
"Search should find domain when searching by hyphenated contact ident"
end
end