diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-01-22 10:37:57 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-01-22 10:37:57 +0000 |
commit | 13f28858baf5965502456d25142631744aa69ce0 (patch) | |
tree | 456b61d03256cd16b253612e6b37e10bce0ebf9e /test | |
parent | 41e82c4598767d9bfaf81b890b1597d072853a6c (diff) | |
download | redmine-13f28858baf5965502456d25142631744aa69ce0.tar.gz redmine-13f28858baf5965502456d25142631744aa69ce0.zip |
Fixed that project is ignored when entering an issue id on /time_entries/new form (#10020).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8693 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/timelog_controller_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index 8a68a5dbf..b5af1b5b8 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -209,6 +209,20 @@ class TimelogControllerTest < ActionController::TestCase assert_equal 1, time_entry.project_id end + def test_create_without_project_should_fail_with_issue_not_inside_project + @request.session[:user_id] = 2 + assert_no_difference 'TimeEntry.count' do + post :create, :time_entry => {:project_id => '1', + :activity_id => '11', + :issue_id => '5', + :spent_on => '2008-03-14', + :hours => '7.3'} + end + + assert_response :success + assert assigns(:time_entry).errors[:issue_id].present? + end + def test_create_without_project_should_deny_without_permission @request.session[:user_id] = 2 Project.find(3).disable_module!(:time_tracking) |