Sha256: 37b40f96e5af031e375f4aa91ccb2540f3dee5cdf035aabfeeb0a177beebb6af

Contents?: true

Size: 680 Bytes

Versions: 48

Compression:

Stored size: 680 Bytes

Contents

require 'test_helper'

module Incline
  class UserLoginHistoryTest < ActiveSupport::TestCase
    def setup
      @user = incline_users(:one)
      @item = Incline::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
    end

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

    test 'should validate ip_address' do
      assert_ip_validation @item, :ip_address, :deny_mask
    end

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

  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
incline-0.2.6 test/models/incline/user_login_history_test.rb
incline-0.2.5 test/models/incline/user_login_history_test.rb
incline-0.2.4 test/models/incline/user_login_history_test.rb
incline-0.2.3 test/models/incline/user_login_history_test.rb
incline-0.1.9 test/models/incline/user_login_history_test.rb
incline-0.1.8 test/models/incline/user_login_history_test.rb
incline-0.1.7 test/models/incline/user_login_history_test.rb
incline-0.1.5 test/models/incline/user_login_history_test.rb