diff options
author | Go MAEDA <maeda@farend.jp> | 2018-09-14 03:40:37 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2018-09-14 03:40:37 +0000 |
commit | 156b8e2ee638428cfa1387d783237a82c573f9cd (patch) | |
tree | ec943afeb8236b06a695624befaaa3883b9774a0 /test/functional | |
parent | f288ccb9871fc4d5271b3d5c40a68f487c5b4ae5 (diff) | |
download | redmine-156b8e2ee638428cfa1387d783237a82c573f9cd.tar.gz redmine-156b8e2ee638428cfa1387d783237a82c573f9cd.zip |
Allow project bulk edit of time entries (#26534).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@17482 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/timelog_controller_test.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index 943d69cbc..273446fd8 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -545,6 +545,11 @@ class TimelogControllerTest < Redmine::ControllerTest end assert_select 'form#bulk_edit_form[action=?]', '/time_entries/bulk_update' do + assert_select 'select[name=?]', 'time_entry[project_id]' + + # Clear issue checkbox + assert_select 'input[name=?][value=?]', 'time_entry[issue_id]', 'none' + # System wide custom field assert_select 'select[name=?]', 'time_entry[custom_field_values][10]' @@ -563,6 +568,34 @@ class TimelogControllerTest < Redmine::ControllerTest assert_response :success end + def test_get_bulk_edit_on_different_projects_should_propose_only_common_activites + project = Project.find(3) + TimeEntryActivity.create!(:name => 'QA', :project => project, :parent => TimeEntryActivity.find_by_name('QA'), :active => false) + @request.session[:user_id] = 1 + + get :bulk_edit, :params => {:ids => [1, 2, 4]} + assert_response :success + assert_select 'select[id=?]', 'time_entry_activity_id' do + assert_select 'option', 3 + assert_select 'option[value=?]', '11', 0, :text => 'QA' + end + end + + def test_get_bulk_edit_on_same_project_should_propose_project_activities + project = Project.find(1) + override_activity = TimeEntryActivity.create!({:name => "QA override", :parent => TimeEntryActivity.find_by_name("QA"), :project => project}) + + @request.session[:user_id] = 1 + + get :bulk_edit, :params => {:ids => [1, 2]} + assert_response :success + + assert_select 'select[id=?]', 'time_entry_activity_id' do + assert_select 'option', 4 + assert_select 'option[value=?]', override_activity.id.to_s, :text => 'QA override' + end + end + def test_bulk_edit_with_edit_own_time_entries_permission @request.session[:user_id] = 2 Role.find_by_name('Manager').remove_permission! :edit_time_entries |