]> source.dussan.org Git - redmine.git/commitdiff
Add test for r22895 (#40860).
authorGo MAEDA <maeda@farend.jp>
Tue, 25 Jun 2024 02:15:35 +0000 (02:15 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 25 Jun 2024 02:15:35 +0000 (02:15 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@22896 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/issue_test.rb

index 21a295aa1753abb652fd420b0d70cc1b382d471c..b35bf97a45dd804269df19663f60bb43d64f5300 100644 (file)
@@ -83,6 +83,16 @@ class IssueTest < ActiveSupport::TestCase
     assert_save issue
   end
 
+  def test_create_with_no_priority_defined
+    IssuePriority.delete_all
+    issue = Issue.new(
+      project_id: 1, tracker_id: 1, author_id: 3, subject: 'test_create_with_no_priority_defined'
+    )
+
+    assert_nothing_raised {assert_not issue.save}
+    assert_include 'Priority cannot be blank', issue.errors.full_messages
+  end
+
   def test_default_priority_should_be_set_when_priority_field_is_disabled
     tracker = Tracker.find(1)
     tracker.core_fields = tracker.core_fields - ['priority_id']