2013-11-14 10:54:09 +01:00
|
|
|
require 'test_helper'
|
|
|
|
|
2014-08-06 14:47:47 +02:00
|
|
|
# Some tests for moderators
|
2013-11-14 10:54:09 +01:00
|
|
|
class UserTest < ActiveSupport::TestCase
|
2014-08-06 14:47:47 +02:00
|
|
|
test 'basic user' do
|
2014-01-10 16:35:58 +01:00
|
|
|
@user = User.new(
|
|
|
|
email: 'original@example.com',
|
|
|
|
firstname: 'first',
|
|
|
|
lastname: 'last',
|
|
|
|
login: 'login',
|
|
|
|
password: 'abcdefghijklmnopqrstuvwxyz'
|
|
|
|
)
|
|
|
|
assert_not_nil @user
|
|
|
|
assert_equal 'c3fcd3d76192e4007dfb496cca67e13b', @user.encrypted_password
|
|
|
|
end
|
|
|
|
|
2014-08-06 14:47:47 +02:00
|
|
|
test 'the password' do
|
2014-01-10 16:35:58 +01:00
|
|
|
@user = User.new(
|
|
|
|
email: 'original@example.com',
|
|
|
|
firstname: 'first',
|
|
|
|
lastname: 'last',
|
|
|
|
login: 'login',
|
|
|
|
password: 'abcdefghijklmnopqrstuvwxyz'
|
|
|
|
)
|
|
|
|
assert @user.valid_password? 'abcdefghijklmnopqrstuvwxyz'
|
2013-11-25 00:35:40 +01:00
|
|
|
end
|
2013-11-14 10:54:09 +01:00
|
|
|
end
|