bugfixing

This commit is contained in:
Christian Mehlmauer
2012-09-20 22:12:10 +02:00
parent 520cbdcf9b
commit 55996b4c90
2 changed files with 6 additions and 1 deletions

View File

@@ -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

View File

@@ -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