Sha256: a53f7f7cde7e0690b6efe92a0a9b5f1686064a25d8094d3999a130cbe7f5d92a

Contents?: true

Size: 766 Bytes

Versions: 2

Compression:

Stored size: 766 Bytes

Contents

require 'test_helper'

class UserLoginHistoryTest < ActiveSupport::TestCase

  def setup
    @user = users(:user_5)
    @item = UserLoginHistory.new(user: @user, ip_address: '1.2.3.4')
  end

  test 'should be valid' do
    assert @item.valid?
  end

  test 'should require user' do
    assert_required @item, :user
    assert_required @item, :user_id
  end

  test 'should require ip_address' do
    assert_required @item, :ip_address
  end

  test 'ip_address should not be too long' do
    assert_max_length @item, :ip_address, 64
  end

  test 'message should not be too long' do
    assert_max_length @item, :message, 200
  end

  test 'timestamps should be in utc' do
    @item.save!
    assert @item.created_at.utc?
    assert @item.updated_at.utc?
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
barkest_core-1.5.4.0 test/models/user_login_history_test.rb
barkest_core-1.5.3.0 test/models/user_login_history_test.rb