bugfixing
This commit is contained in:
@@ -90,7 +90,7 @@ module WpUsernames
|
||||
end
|
||||
junk = get_equal_string_end(real_names)
|
||||
usernames.each do |u|
|
||||
u[:real_name] = u[:real_name].sub(/#{junk}$/, "")
|
||||
u[:real_name] = u[:real_name].sub(/#{Regexp.escape(junk)}$/, "")
|
||||
end
|
||||
usernames
|
||||
end
|
||||
|
||||
@@ -65,5 +65,10 @@ describe "common_helper" do
|
||||
@input = %w{ user1 }
|
||||
@expected = ""
|
||||
end
|
||||
|
||||
it "sould return | test" do
|
||||
@input = ["admin | test", "test | test"]
|
||||
@expected = " | test"
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user