diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-05-29 18:54:26 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-05-29 18:54:26 +0000 |
commit | 4ee133e77eb7aea17f4674765d587708917da661 (patch) | |
tree | 04ca05f55edfedd8f3dfe915da05ec7756e4a22b /test/functional/timelog_controller_test.rb | |
parent | 53a0cee57a0bbda3d47791eb189b5f4bd6511760 (diff) | |
download | redmine-4ee133e77eb7aea17f4674765d587708917da661.tar.gz redmine-4ee133e77eb7aea17f4674765d587708917da661.zip |
Fixed that project, issue and activity should be preserved when logging time with "Create and continue" (#11038).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9741 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/timelog_controller_test.rb')
-rw-r--r-- | test/functional/timelog_controller_test.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index e64919f38..c972fc2ab 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -65,6 +65,17 @@ class TimelogControllerTest < ActionController::TestCase assert_select 'input[name=project_id]', 0 end + def test_new_without_project_should_prefill_the_form + @request.session[:user_id] = 3 + get :new, :time_entry => {:project_id => '1'} + assert_response :success + assert_template 'new' + assert_select 'select[name=?]', 'time_entry[project_id]' do + assert_select 'option[value=1][selected=selected]' + end + assert_select 'input[name=project_id]', 0 + end + def test_new_without_project_should_deny_without_permission Role.all.each {|role| role.remove_permission! :log_time} @request.session[:user_id] = 3 @@ -146,7 +157,7 @@ class TimelogControllerTest < ActionController::TestCase :spent_on => '2008-03-14', :hours => '7.3'}, :continue => '1' - assert_redirected_to '/projects/ecookbook/time_entries/new' + assert_redirected_to '/projects/ecookbook/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=' end def test_create_and_continue_with_issue_id @@ -157,7 +168,7 @@ class TimelogControllerTest < ActionController::TestCase :spent_on => '2008-03-14', :hours => '7.3'}, :continue => '1' - assert_redirected_to '/projects/ecookbook/issues/1/time_entries/new' + assert_redirected_to '/projects/ecookbook/issues/1/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=1' end def test_create_and_continue_without_project @@ -169,7 +180,7 @@ class TimelogControllerTest < ActionController::TestCase :hours => '7.3'}, :continue => '1' - assert_redirected_to '/time_entries/new' + assert_redirected_to '/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=1' end def test_create_without_log_time_permission_should_be_denied |