On 03/05/12 13:13 -0400, Matt Wagner wrote:
Appending an integer to a string does bad things and can include
escape characters. There is no requirement that the string actually
be unique/random, though, so just use a static string.
---
src/features/step_definitions/authentication.rb | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/src/features/step_definitions/authentication.rb
b/src/features/step_definitions/authentication.rb
index bde0975..2364c6a 100644
--- a/src/features/step_definitions/authentication.rb
+++ b/src/features/step_definitions/authentication.rb
@@ -91,9 +91,7 @@ Then /^there should not be user with login "([^\"]*)"$/
do |login|
end
When /^I enter a string of length "([^"]*)" into
"([^"]*)"$/ do |length, field_name|
- valid_chars = [*('a'..'z')] + [*('A'..'Z')] + [*(1..9)]
+ ['_', '-']
- string = ""
- length.to_i.times { string << valid_chars[rand(valid_chars.length)] }
+ string = 'x' * length.to_i
When "I fill in \"#{field_name}\" with \"#{string}\""
end
--
1.7.7.6
ACK, test didn't fail for me before, but continues to pass with this
change.
-j