Rails has removed SecureRandom from ActiveSupport in Rails 3.2,

deprecated

* Changing references in generators and encryptable_test
This commit is contained in:
Paul Bellamy 2011-05-28 14:44:54 +01:00
parent 69126a31db
commit 0bcf71f8df
3 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
require 'active_support/secure_random'
require 'securerandom'
module Devise
module Generators
@ -21,4 +21,4 @@ module Devise
end
end
end
end
end

View File

@ -54,7 +54,7 @@ Devise.setup do |config|
config.stretches = 10
# Setup a pepper to generate the encrypted password.
# config.pepper = <%= ActiveSupport::SecureRandom.hex(64).inspect %>
# config.pepper = <%= SecureRandom.hex(64).inspect %>
# ==> Configuration for :confirmable
# The time you want to give your user to confirm his account. During this time

View File

@ -31,7 +31,7 @@ class EncryptableTest < ActiveSupport::TestCase
test 'should generate a base64 hash using SecureRandom for password salt' do
swap_with_encryptor Admin, :sha1 do
ActiveSupport::SecureRandom.expects(:base64).with(15).returns('friendly_token')
SecureRandom.expects(:base64).with(15).returns('friendly_token')
assert_equal 'friendly_token', create_admin.password_salt
end
end