diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-15 19:06:22 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-15 19:06:22 +0000 |
commit | 589bde0899cc72c7a5c253a6f1da4e0408de031f (patch) | |
tree | e3d4c23d04dea43b7db4505dcd641e273910bf32 /test/functional/activities_controller_test.rb | |
parent | 486a4dfbc82a5ffc5dd89f94bb44edd5a7f127cd (diff) | |
download | redmine-589bde0899cc72c7a5c253a6f1da4e0408de031f.tar.gz redmine-589bde0899cc72c7a5c253a6f1da4e0408de031f.zip |
Activity page to remember user's selection of activities (#1605).
git-svn-id: http://svn.redmine.org/redmine/trunk@14678 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/activities_controller_test.rb')
-rw-r--r-- | test/functional/activities_controller_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/activities_controller_test.rb b/test/functional/activities_controller_test.rb index 6a1d2a7db..34a15ee71 100644 --- a/test/functional/activities_controller_test.rb +++ b/test/functional/activities_controller_test.rb @@ -157,4 +157,23 @@ class ActivitiesControllerTest < ActionController::TestCase assert_response :success assert_not_include journal, assigns(:events_by_day).values.flatten end + + def test_index_with_submitted_scope_should_save_as_preference + @request.session[:user_id] = 2 + + get :index, :show_issues => '1', :show_messages => '1', :submit => 'Apply' + assert_response :success + assert_equal %w(issues messages), User.find(2).pref.activity_scope.sort + end + + def test_index_scope_should_default_to_user_preference + pref = User.find(2).pref + pref.activity_scope = %w(issues news) + pref.save! + @request.session[:user_id] = 2 + + get :index + assert_response :success + assert_equal %w(issues news), assigns(:activity).scope + end end |