Sha256: badf7f5fbe1fdda582fb4d7e7c456966b0aef5158a8ef51453de3ea3311dd67b
Contents?: true
Size: 849 Bytes
Versions: 14
Compression:
Stored size: 849 Bytes
Contents
require_relative '../helpers/test_helper' require_relative 'configuration' module Configuration class FinderTest < Minitest::Test def setup Enumerations.configure do |config| config.primary_key = :id config.foreign_key_suffix = :id end end def teardown Enumerations.restore_default_configuration end def test_lookup_by_key enum = CustomEnum.find(:draft) assert_equal :draft, enum.symbol end def test_lookup_by_string_key enum = CustomEnum.find('draft') assert_equal :draft, enum.symbol end def test_lookup_by_primary_key enum = CustomEnum.find(1) assert_equal :draft, enum.symbol end def test_lookup_by_primary_key_as_string enum = CustomEnum.find('1') assert_equal :draft, enum.symbol end end end
Version data entries
14 entries across 14 versions & 1 rubygems