Skip to content

Commit c0a110f

Browse files
committed
Testrun: Validate cause
1 parent cc10d3c commit c0a110f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/models/testrun.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class Testrun < ApplicationRecord
88
has_many :testrun_messages, dependent: :destroy
99

1010
CONSOLE_OUTPUT = %w[stdout stderr].freeze
11+
CAUSES = %w[assess run].freeze
1112

1213
enum :status, {
1314
ok: 0,
@@ -21,6 +22,7 @@ class Testrun < ApplicationRecord
2122

2223
validates :exit_code, numericality: {only_integer: true, min: 0, max: 255}, allow_nil: true
2324
validates :status, presence: true
25+
validates :cause, inclusion: {in: CAUSES}
2426

2527
def log
2628
if testrun_messages.loaded?

0 commit comments

Comments
 (0)