Sha256: 741b665d17b1a25e53f7c1ce465233eb028c7b40add139dc8b31ee979720cc67

Contents?: true

Size: 384 Bytes

Versions: 11

Compression:

Stored size: 384 Bytes

Contents

# frozen_string_literal: true

require "test_helper"

class ValidatesurlFormatUrlWithTldValidationTest < Minitest::Test
  test "rejects invalid TLD" do
    user = UserWithTLD.new("http://example.xy")
    refute user.valid?
  end

  TLDs.each do |tld|
    test "accepts #{tld} as TLD" do
      user = UserWithTLD.new("http://example.#{tld}")
      assert user.valid?
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
validators-3.3.0 test/validators/validates_url_format_of/with_tld_validation_test.rb
validators-3.2.1 test/validators/validates_url_format_of/with_tld_validation_test.rb
validators-3.2.0 test/validators/validates_url_format_of/with_tld_validation_test.rb
validators-3.1.1 test/validators/validates_url_format_of/with_tld_validation_test.rb
validators-3.1.0 test/validators/validates_url_format_of/with_tld_validation_test.rb
validators-3.0.5 test/validators/validates_url_format_of/with_tld_validation_test.rb
validators-3.0.4 test/validators/validates_url_format_of/with_tld_validation_test.rb
validators-3.0.3 test/validators/validates_url_format_of/with_tld_validation_test.rb
validators-3.0.2 test/validators/validates_url_format_of/with_tld_validation_test.rb
validators-3.0.1 test/validators/validates_url_format_of/with_tld_validation_test.rb
validators-3.0.0 test/validators/validates_url_format_of/with_tld_validation_test.rb