Sha256: 2f245e3b34ed12f87fdcd26349fc61bdf98d9da96ffe5d0fdb501cdd2a3a857d
Contents?: true
Size: 1.21 KB
Versions: 2
Compression:
Stored size: 1.21 KB
Contents
require File.expand_path('../../test_helper', __FILE__) class UserWithPassword < User include Authpwn::UserExtensions::PasswordField end class PasswordFieldTest < ActiveSupport::TestCase def setup @user = UserWithPassword.new password: 'awesome', password_confirmation: 'awesome' @john = UserWithPassword.find_by_id(users(:john).id) @jane = UserWithPassword.find_by_id(users(:jane).id) @bill = UserWithPassword.find_by_id(users(:bill).id) end test 'setup' do assert @user.valid? end test 'password can be missing for non-password logins' do user = UserWithPassword.new assert user.valid? end test 'password cannot be empty' do @user.password = @user.password_confirmation = '' assert !@user.valid? end test 'password assumed ok for existing records' do @john.save! assert @john.valid? end test 'password confirmation' do @user.password_confirmation = 'not awesome' assert !@user.valid? end test 'password_credential' do assert_equal credentials(:john_password), @john.password_credential assert_equal credentials(:jane_password), @jane.password_credential assert_nil @bill.password_credential end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
authpwn_rails-0.17.2 | test/user_extensions/password_field_test.rb |
authpwn_rails-0.17.1 | test/user_extensions/password_field_test.rb |