-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4414b5f
commit c39dae5
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'test_helper' | ||
|
||
class SearchUserTest < ActiveSupport::TestCase | ||
include SearchUser | ||
|
||
test '検索文字が半角英文字2文字以下の時' do | ||
assert_nil validate_search_word('ki') | ||
end | ||
|
||
test '検索文字が半角英文字3文字以上の時' do | ||
assert_equal 'kim', validate_search_word('kim') | ||
end | ||
|
||
test '検索文字が全角英文字1文字以下の時' do | ||
assert_nil validate_search_word('き') | ||
end | ||
|
||
test '検索文字が全角英文字2文字以下の時' do | ||
assert_equal 'きむ', validate_search_word('きむ') | ||
end | ||
|
||
test '前後の空白は削除されること' do | ||
assert_equal 'kim', validate_search_word(' kim ') | ||
end | ||
end |