mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 20:36:27 +02:00
Adds settings to make the issue and/or comment fields mandatory for time logs (#24577).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@16176 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -172,4 +172,13 @@ class TimeEntryTest < ActiveSupport::TestCase
|
||||
:activity => activity)
|
||||
assert_equal project.id, te.project.id
|
||||
end
|
||||
|
||||
def test_create_with_required_issue_id_and_comment_should_be_validated
|
||||
with_settings :timelog_required_fields => ['issue_id' , 'comments'] do
|
||||
entry = TimeEntry.new(:project => Project.find(1), :spent_on => Date.today, :user => User.find(1), :activity => TimeEntryActivity.first, :hours => 1)
|
||||
|
||||
assert !entry.save
|
||||
assert_equal ["Comment cannot be blank", "Issue cannot be blank"], entry.errors.full_messages.sort
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user