Permalink
Browse files

update random class to not include - and _ characters

  • Loading branch information...
1 parent c52993c commit 086498dfaa29e7672370d7dded21a4a3f7b18c95 @binarylogic committed Aug 4, 2010
Showing with 1 addition and 8 deletions.
  1. +1 −1 lib/authlogic/random.rb
  2. +0 −7 test/random_test.rb
View
@@ -13,7 +13,7 @@ def hex_token
def friendly_token
# use base64url as defined by RFC4648
- SecureRandom.base64(15).tr('+/=', '-_ ').strip.delete("\n")
+ SecureRandom.base64(15).tr('+/=', '').strip.delete("\n")
end
else
def hex_token
View
@@ -1,13 +1,6 @@
require File.dirname(__FILE__) + '/test_helper.rb'
class RandomTest < ActiveSupport::TestCase
- def test_random_tokens_have_consisten_length
- with_any_random do
- assert_equal 128, Authlogic::Random.hex_token.length
- assert_equal 20, Authlogic::Random.friendly_token.length
- end
- end
-
def test_random_tokens_are_indeed_random
# this might fail if you are *really* unlucky :)
with_any_random do

0 comments on commit 086498d

Please sign in to comment.