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:
parent
26e4899765
commit
e81ef16bc9
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue