Sha256: 979e31111cfe5cc26515c504675ef707174e84bf588b67e4581baefd27995d65

Contents?: true

Size: 953 Bytes

Versions: 1

Compression:

Stored size: 953 Bytes

Contents

require 'test_helper'

class Ccls::StateTest < ActiveSupport::TestCase

	assert_should_create_default_object
	assert_should_act_as_list
	assert_should_require_attributes( :code, :name, :fips_state_code, :fips_country_code )
	assert_should_require_unique_attributes( :code, :name, :fips_state_code )
	assert_should_not_require_attributes( :position )
	assert_should_require_attribute_length( :code, :name, 
		:fips_state_code, :fips_country_code, 
			:maximum => 250 )

	test "explicit Factory state test" do
		assert_difference('State.count',1) {
			state = Factory(:state)
			assert_match /Code\d*/, state.code
			assert_match /Name\d*/, state.name
			assert_not_nil state.fips_state_code
			assert_equal 'US', state.fips_country_code
		}
	end

	test "should return an array of state abbreviations" do
		abbreviations = State.abbreviations
		assert_not_nil abbreviations
		assert abbreviations.is_a?(Array)
		assert abbreviations.length > 50
	end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ccls-ccls_engine-3.11.0 test/unit/ccls/state_test.rb