Sha256: 87e958d00bff41d3003b04db0a3c8efdf953b6ee82bc87a7825d2e6daf54bbe4

Contents?: true

Size: 877 Bytes

Versions: 9

Compression:

Stored size: 877 Bytes

Contents

require 'test_helper'

module Shoppe
  class UserTest < ActiveSupport::TestCase
    
    test "authentication" do
      user = User.create(:email_address => 'adam@niftyware.io', :password => 'llamafarm', :password_confirmation => 'llamafarm', :first_name => 'Adam', :last_name => 'Cooke')

      authed_user = User.authenticate('adam@niftyware.io', 'llamafarm')
      assert_equal User, authed_user.class
      assert_equal user, authed_user
      authed_user = User.authenticate('adam@niftyware.io', 'invalid')
      assert_equal false, authed_user
    end
    
    test "full name" do
      user = User.new(:first_name => 'Adam', :last_name => 'Cooke')
      assert_equal "Adam Cooke", user.full_name
    end
    
    test "short name" do
      user = User.new(:first_name => 'Adam', :last_name => 'Cooke')
      assert_equal "Adam C", user.short_name
    end
    
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shoppe-0.0.19 test/models/shoppe/user_test.rb
shoppe-0.0.18 test/models/shoppe/user_test.rb
shoppe-0.0.17 test/models/shoppe/user_test.rb
shoppe-0.0.16 test/models/shoppe/user_test.rb
shoppe-0.0.15 test/models/shoppe/user_test.rb
shoppe-0.0.14 test/models/shoppe/user_test.rb
shoppe-0.0.13 test/models/shoppe/user_test.rb
shoppe-0.0.12 test/models/shoppe/user_test.rb
shoppe-0.0.11 test/models/shoppe/user_test.rb