remove unnuesd global regex flag g

This commit is contained in:
Roger Rüttimann 2019-02-05 13:01:50 +01:00
parent 3197cd9b6c
commit 28afbe4606
2 changed files with 2 additions and 2 deletions

View file

@ -30,7 +30,7 @@ module UsersHelper
pattern, options = if settings.user_default_internal_regex_enabled?
regex = settings.user_default_internal_regex_instance
JsRegex.new(regex, options: 'g').to_h.slice(:source, :options).values
JsRegex.new(regex).to_h.slice(:source, :options).values
end
{ user_internal_regex_pattern: pattern, user_internal_regex_options: options }

View file

@ -51,7 +51,7 @@ describe UsersHelper do
false | 'mockRegexPattern' | { user_internal_regex_pattern: nil, user_internal_regex_options: nil }
true | nil | { user_internal_regex_pattern: nil, user_internal_regex_options: nil }
true | '' | { user_internal_regex_pattern: nil, user_internal_regex_options: nil }
true | 'mockRegexPattern' | { user_internal_regex_pattern: 'mockRegexPattern', user_internal_regex_options: 'gi' }
true | 'mockRegexPattern' | { user_internal_regex_pattern: 'mockRegexPattern', user_internal_regex_options: 'i' }
end
with_them do