1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add a regression test for #39673

This commit is contained in:
Ryuta Kamizono 2020-06-20 12:52:20 +09:00
parent 26e4899765
commit e81ef16bc9

View file

@ -592,6 +592,17 @@ class EnumTest < ActiveRecord::TestCase
assert_raises(NoMethodError) { klass.proposed }
end
test "capital characters for enum names" do
klass = Class.new(ActiveRecord::Base) do
self.table_name = "computers"
enum extendedWarranty: [:extendedSilver, :extendedGold]
end
computer = klass.extendedSilver.build
assert_predicate computer, :extendedSilver?
assert_not_predicate computer, :extendedGold?
end
test "enums with a negative condition log a warning" do
old_logger = ActiveRecord::Base.logger
logger = ActiveSupport::LogSubscriber::TestHelper::MockLogger.new