Sha256: 7583e488142c6c814338d90ef85075f45d21acafb2ef023a9e3984a1efb23efb

Contents?: true

Size: 469 Bytes

Versions: 14

Compression:

Stored size: 469 Bytes

Contents

# frozen_string_literal: true

require "test_helper"

class Ipv6Test < Minitest::Test
  let(:user) { User.new }

  test "is valid" do
    User.validates_ip_address :url, only: :v6
    user.url = "FE80:0000:0000:0000:0202:B3FF:FE1E:8329"

    assert user.valid?
  end

  test "is invalid" do
    User.validates_ip_address :url, only: :v6
    user.url = "192.168.1.2"

    refute user.valid?
    assert_includes user.errors[:url], "is not a valid IPv6 address"
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
validators-3.4.2 test/validators/validates_ip_address/ipv6_test.rb
validators-3.4.1 test/validators/validates_ip_address/ipv6_test.rb
validators-3.4.0 test/validators/validates_ip_address/ipv6_test.rb
validators-3.3.0 test/validators/validates_ip_address/ipv6_test.rb
validators-3.2.1 test/validators/validates_ip_address/ipv6_test.rb
validators-3.2.0 test/validators/validates_ip_address/ipv6_test.rb
validators-3.1.1 test/validators/validates_ip_address/ipv6_test.rb
validators-3.1.0 test/validators/validates_ip_address/ipv6_test.rb
validators-3.0.5 test/validators/validates_ip_address/ipv6_test.rb
validators-3.0.4 test/validators/validates_ip_address/ipv6_test.rb
validators-3.0.3 test/validators/validates_ip_address/ipv6_test.rb
validators-3.0.2 test/validators/validates_ip_address/ipv6_test.rb
validators-3.0.1 test/validators/validates_ip_address/ipv6_test.rb
validators-3.0.0 test/validators/validates_ip_address/ipv6_test.rb