aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/attributes_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/attributes_test.rb')
-rw-r--r--activerecord/test/cases/attributes_test.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/activerecord/test/cases/attributes_test.rb b/activerecord/test/cases/attributes_test.rb
index c18851257e..3705a6be89 100644
--- a/activerecord/test/cases/attributes_test.rb
+++ b/activerecord/test/cases/attributes_test.rb
@@ -112,7 +112,7 @@ module ActiveRecord
assert_equal 7, klass.attribute_types.length
assert_equal 7, klass.column_defaults.length
- assert klass.attribute_types.include?("wibble")
+ assert_includes klass.attribute_types, "wibble"
end
test "the given default value is cast from user" do
@@ -253,7 +253,15 @@ module ActiveRecord
test "attributes not backed by database columns appear in inspect" do
inspection = OverloadedType.new.inspect
- assert inspection.include?("non_existent_decimal")
+ assert_includes inspection, "non_existent_decimal"
+ end
+
+ test "attributes do not require a type" do
+ klass = Class.new(OverloadedType) do
+ attribute :no_type
+ end
+ assert_equal 1, klass.new(no_type: 1).no_type
+ assert_equal "foo", klass.new(no_type: "foo").no_type
end
end
end