Moving perishable inclusion to active_record devise, to include just once. Also refactor confirm! method.

This commit is contained in:
Carlos A. da Silva
2009-10-15 16:43:30 -03:00
parent 7f91651d0c
commit 417f273a81
5 changed files with 17 additions and 12 deletions

View File

@@ -52,7 +52,7 @@ class PerishableTest < ActiveSupport::TestCase
end
test 'should generate a sha1 hash for perishable token' do
ActiveSupport::SecureRandom.expects(:base64).with(15).times(3).returns('perishable token')
ActiveSupport::SecureRandom.expects(:base64).with(15).twice.returns('perishable token')
assert_equal 'perishable token', create_user.perishable_token
end
end