summaryrefslogtreecommitdiffstats
path: root/test/unit/time_entry_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/time_entry_test.rb')
-rw-r--r--test/unit/time_entry_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/time_entry_test.rb b/test/unit/time_entry_test.rb
index 6d04619e8..19b1ba2a4 100644
--- a/test/unit/time_entry_test.rb
+++ b/test/unit/time_entry_test.rb
@@ -175,6 +175,18 @@ class TimeEntryTest < ActiveSupport::TestCase
end
end
+ def test_should_not_accept_closed_issue
+ with_settings :timelog_accept_closed_issues => '0' do
+ project = Project.find(1)
+ entry = TimeEntry.generate project: project
+ issue = project.issues.to_a.detect(&:closed?)
+ entry.issue = issue
+ assert !entry.save
+ assert entry.errors[:base].present?
+ assert_equal 'Cannot log time on a closed issue', entry.errors[:base].first
+ end
+ end
+
def test_should_require_spent_on
with_settings :timelog_accept_future_dates => '0' do
entry = TimeEntry.find(1)