aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-09-18 14:04:47 +0900
committerGitHub <noreply@github.com>2017-09-18 14:04:47 +0900
commit58c1dda4a21291d0d0d51342e275dd02228022f0 (patch)
tree3e2b91d56fb4791988b1d094ef816e37ddc2099f
parent8cde75813d54b92a894fb47d296929e8a6d26ba1 (diff)
parent46d0bbdbdeedc1001922858f49d1caa9785e0345 (diff)
downloadrails-58c1dda4a21291d0d0d51342e275dd02228022f0.tar.gz
rails-58c1dda4a21291d0d0d51342e275dd02228022f0.tar.bz2
rails-58c1dda4a21291d0d0d51342e275dd02228022f0.zip
Merge pull request #26707 from jcoleman/add_attribute_names_cache_busting_spec
Add test validating that Model.attribute_names cache is busted
-rw-r--r--activerecord/test/cases/attributes_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/cases/attributes_test.rb b/activerecord/test/cases/attributes_test.rb
index 29a25b4461..2caf2a63d4 100644
--- a/activerecord/test/cases/attributes_test.rb
+++ b/activerecord/test/cases/attributes_test.rb
@@ -108,12 +108,14 @@ module ActiveRecord
assert_equal 6, klass.attribute_types.length
assert_equal 6, klass.column_defaults.length
+ assert_equal 6, klass.attribute_names.length
assert_not klass.attribute_types.include?("wibble")
klass.attribute :wibble, Type::Value.new
assert_equal 7, klass.attribute_types.length
assert_equal 7, klass.column_defaults.length
+ assert_equal 7, klass.attribute_names.length
assert_includes klass.attribute_types, "wibble"
end