diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-19 13:32:21 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-19 13:32:21 +0000 |
commit | 9d120c872c1b5849d987e3950f2cf914e1e34fe2 (patch) | |
tree | 1e7f18d27c5fd988b027a51de6fff78d061b551e /test/functional/my_controller_test.rb | |
parent | 008ad85d10c299f4bcca25a20753740836325786 (diff) | |
download | redmine-9d120c872c1b5849d987e3950f2cf914e1e34fe2.tar.gz redmine-9d120c872c1b5849d987e3950f2cf914e1e34fe2.zip |
Fixes block reordering on my page (#2971).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3194 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/my_controller_test.rb')
-rw-r--r-- | test/functional/my_controller_test.rb | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb index 8862466e7..ef12d7864 100644 --- a/test/functional/my_controller_test.rb +++ b/test/functional/my_controller_test.rb @@ -22,7 +22,7 @@ require 'my_controller' class MyController; def rescue_action(e) raise e end; end class MyControllerTest < ActionController::TestCase - fixtures :users, :issues, :issue_statuses, :trackers, :enumerations, :custom_fields + fixtures :users, :user_preferences, :roles, :projects, :issues, :issue_statuses, :trackers, :enumerations, :custom_fields def setup @controller = MyController.new @@ -105,4 +105,28 @@ class MyControllerTest < ActionController::TestCase assert_redirected_to 'my/account' assert User.try_to_login('jsmith', 'hello') end + + def test_page_layout + get :page_layout + assert_response :success + assert_template 'page_layout' + end + + def test_add_block + xhr :post, :add_block, :block => 'issuesreportedbyme' + assert_response :success + assert User.find(2).pref[:my_page_layout]['top'].include?('issuesreportedbyme') + end + + def test_remove_block + xhr :post, :remove_block, :block => 'issuesassignedtome' + assert_response :success + assert !User.find(2).pref[:my_page_layout].values.flatten.include?('issuesassignedtome') + end + + def test_order_blocks + xhr :post, :order_blocks, :group => 'left', 'list-left' => ['documents', 'calendar', 'latestnews'] + assert_response :success + assert_equal ['documents', 'calendar', 'latestnews'], User.find(2).pref[:my_page_layout]['left'] + end end |