mirror of
https://github.com/internetee/registry.git
synced 2025-08-16 14:33:55 +02:00
Merge a8f13b6920
into c8a0788366
This commit is contained in:
commit
988b7c2436
2 changed files with 27 additions and 2 deletions
|
@ -1,10 +1,9 @@
|
|||
class PartialSearchFormatter
|
||||
def self.format(params)
|
||||
search_params = params.deep_dup
|
||||
|
||||
|
||||
search_params.each do |key, value|
|
||||
next unless should_format?(key, value)
|
||||
|
||||
search_params[key] = format_value(value)
|
||||
end
|
||||
|
||||
|
|
26
test/integration/admin_area/domain_test.rb
Normal file
26
test/integration/admin_area/domain_test.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue