aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/store_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/store_test.rb')
-rw-r--r--activerecord/test/cases/store_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/store_test.rb b/activerecord/test/cases/store_test.rb
index e401dd4b12..3e60b62fd5 100644
--- a/activerecord/test/cases/store_test.rb
+++ b/activerecord/test/cases/store_test.rb
@@ -34,6 +34,11 @@ class StoreTest < ActiveRecord::TestCase
assert @john.settings_changed?
end
+ test "updating the store won't mark it as changed if an attribute isn't changed" do
+ @john.color = @john.color
+ assert !@john.settings_changed?
+ end
+
test "object initialization with not nullable column" do
assert_equal true, @john.remember_login
end
@@ -115,4 +120,11 @@ class StoreTest < ActiveRecord::TestCase
test "stored attributes are returned" do
assert_equal [:color, :homepage], Admin::User.stored_attributes[:settings]
end
+
+ test "stores_attributes are class level settings" do
+ assert_raise NoMethodError do
+ @john.stored_attributes = {}
+ end
+ end
+
end