Skip to content

Commit 695683f

Browse files
monorkinrosa
authored andcommitted
Fix typo in error message
1 parent 73b4dac commit 695683f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/models/solid_queue/recurring_task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def supported_schedule
110110

111111
def ensure_command_or_class_present
112112
unless command.present? || class_name.present?
113-
errors.add :base, :command_and_class_blank, message: "either command or class_name must be present"
113+
errors.add :base, :command_and_class_blank, message: "either command or class must be present"
114114
end
115115
end
116116

test/models/solid_queue/recurring_task_test.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ def perform
154154
assert_not recurring_task_with(class_name: "UnknownJob").valid?
155155

156156
# Empty class name and command
157-
assert_not recurring_task_with(key: "task-id", schedule: "every minute").valid?
157+
task = SolidQueue::RecurringTask.from_configuration("task-id", schedule: "every minute")
158+
assert_not task.valid?
159+
assert_includes task.errors[:base], "either command or class must be present"
158160
end
159161

160162
test "task with custom queue and priority" do

0 commit comments

Comments
 (0)