From d21627b70f5431de33a8c532b7b73799c5ae1700 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 15 Mar 2017 17:52:41 +0000 Subject: Clear settings for blocks that are no longer used. git-svn-id: http://svn.redmine.org/redmine/trunk@16405 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/user_preference_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/unit/user_preference_test.rb') diff --git a/test/unit/user_preference_test.rb b/test/unit/user_preference_test.rb index bbf5f70ba..757a795d9 100644 --- a/test/unit/user_preference_test.rb +++ b/test/unit/user_preference_test.rb @@ -93,4 +93,15 @@ class UserPreferenceTest < ActiveSupport::TestCase up[:foo] = 'bar' assert_equal 'bar', up[:foo] end + + def test_removing_a_block_should_clear_its_settings + up = User.find(2).pref + up.my_page_layout = {'top' => ['news', 'documents']} + up.my_page_settings = {'news' => {:foo => 'bar'}, 'documents' => {:baz => 'quz'}} + up.save! + + up.remove_block 'news' + up.save! + assert_equal ['documents'], up.my_page_settings.keys + end end -- cgit v1.2.3