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