Sha256: 9ef8c2f5d8dbc621b22040bf10658828a3e880cf8dd9d1d08d826b09c8834ecb

Contents?: true

Size: 873 Bytes

Versions: 6

Compression:

Stored size: 873 Bytes

Contents

require 'test_helper'

module Shoppe
  class UserTest < ActiveSupport::TestCase
    
    setup do
      @user = User.first
    end
    
    test "authentication" do
      user = User.authenticate('adam@niftyware.io', 'llamafarm')
      assert_equal User, user.class
      user = User.authenticate('adam@niftyware.io', 'invalid')
      assert_equal false, user
    end
    
    test "full name" do
      assert_equal "Adam Cooke", @user.full_name
    end
    
    test "short name" do
      assert_equal "Adam C", @user.short_name
    end
    
    test "user creation" do
      user = User.new
      assert_equal false, user.save
      user.first_name = 'Test'
      user.last_name = 'User'
      user.email_address = 'test@example.com'
      user.password = 'password'
      user.password_confirmation = 'password'
      assert_equal true, user.save
    end
    
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shoppe-0.0.10 test/models/shoppe/user_test.rb
shoppe-0.0.9 test/models/shoppe/user_test.rb
shoppe-0.0.8 test/models/shoppe/user_test.rb
shoppe-0.0.7 test/models/shoppe/user_test.rb
shoppe-0.0.6 test/models/shoppe/user_test.rb
shoppe-0.0.5 test/models/shoppe/user_test.rb