Sha256: fca3d0d9e37166161566d4fbdd6db68961b2f1c5b06ebb87a5ce92b5c317eda6

Contents?: true

Size: 818 Bytes

Versions: 2

Compression:

Stored size: 818 Bytes

Contents

require File.expand_path('../test_helper', __FILE__)

class UserTest < ActiveSupport::TestCase  
  def setup
    @user = User.new
  end
  
  test 'setup' do
    assert @user.valid?
  end
  
  test 'exuid generation' do
    assert @user.valid?
    assert @user.exuid
  end
  
  test 'exuid uniqueness' do
    @user.exuid = users(:john).exuid
    assert !@user.valid?
  end
  
  test 'exuid presence' do
    @user.exuid = ''
    assert !@user.valid?
  end
    
  test 'to_param' do
    assert_equal '56789', users(:john).to_param
  end
  
  test 'find_by_param' do
    assert_equal users(:john), User.find_by_param(users(:john).to_param)
    assert_equal users(:jane), User.find_by_param(users(:jane).to_param)
    assert_equal nil, User.find_by_param('bogus id')
    assert_equal nil, User.find_by_param(nil)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
authpwn_rails-0.10.1 test/user_test.rb
authpwn_rails-0.10.0 test/user_test.rb