Sha256: 5ad003ba59e9da438ca067b94b0b2379d67db490cde73afef6908dedaac6451a

Contents?: true

Size: 860 Bytes

Versions: 144

Compression:

Stored size: 860 Bytes

Contents

require 'test_helper'

class BusinessSupport::BusinessTypeTest < ActiveSupport::TestCase
  setup do
    @charity = BusinessSupport::BusinessType.create(name: "Charity", slug: "charity")
  end

  test "should validate presence of name" do
    refute BusinessSupport::BusinessType.new(slug: "charity").valid?
  end

  test "should validate uniqueness of name" do
    another_type = BusinessSupport::BusinessType.new(name: "Charity", slug: "charity")
    refute another_type.valid?, "should validate uniqueness of name."
  end

  test "should validate presence of slug" do
    refute BusinessSupport::BusinessType.new(name: "Charity").valid?
  end

  test "should validate uniqueness of slug" do
    another_type = BusinessSupport::BusinessType.new(name: "Charity", slug: "charity")
    refute another_type.valid?, "should validate uniqueness of slug."
  end
end

Version data entries

144 entries across 144 versions & 1 rubygems

Version Path
govuk_content_models-42.0.0 test/models/business_support/business_type_test.rb
govuk_content_models-41.1.1 test/models/business_support/business_type_test.rb
govuk_content_models-41.1.0 test/models/business_support/business_type_test.rb
govuk_content_models-41.0.0 test/models/business_support/business_type_test.rb
govuk_content_models-40.0.0 test/models/business_support/business_type_test.rb
govuk_content_models-39.0.0 test/models/business_support/business_type_test.rb
govuk_content_models-38.0.0 test/models/business_support/business_type_test.rb
govuk_content_models-37.0.0 test/models/business_support/business_type_test.rb
govuk_content_models-36.0.0 test/models/business_support/business_type_test.rb
govuk_content_models-35.0.1 test/models/business_support/business_type_test.rb
govuk_content_models-35.0.0 test/models/business_support/business_type_test.rb
govuk_content_models-34.0.0 test/models/business_support/business_type_test.rb
govuk_content_models-33.0.0 test/models/business_support/business_type_test.rb
govuk_content_models-32.3.1 test/models/business_support/business_type_test.rb
govuk_content_models-32.3.0 test/models/business_support/business_type_test.rb
govuk_content_models-32.2.0 test/models/business_support/business_type_test.rb
govuk_content_models-32.1.0 test/models/business_support/business_type_test.rb
govuk_content_models-32.0.0 test/models/business_support/business_type_test.rb
govuk_content_models-31.4.0 test/models/business_support/business_type_test.rb
govuk_content_models-31.3.0 test/models/business_support/business_type_test.rb