From a3d657bfc9dd5cbff23b039eafd550d2b1d287b4 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Thu, 15 Feb 2024 16:23:24 +0100 Subject: [PATCH] Finishing touches --- test/unit/actions/recurring_action_test.rb | 2 +- test/unit/recurring_logic_test.rb | 10 +++++----- test/unit/task_test.rb | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/unit/actions/recurring_action_test.rb b/test/unit/actions/recurring_action_test.rb index 6bf4eb8d7..cd3d084ca 100644 --- a/test/unit/actions/recurring_action_test.rb +++ b/test/unit/actions/recurring_action_test.rb @@ -50,7 +50,7 @@ def run end specify 'it triggers the repeat when task is cancelled' do - assert recurring_task.delayed? + assert_predicate recurring_task, :delayed? assert_equal 1, recurring_logic.tasks.count cancelled_events = recurring_task.execution_plan.cancel cancelled_events.each(&:wait!) diff --git a/test/unit/recurring_logic_test.rb b/test/unit/recurring_logic_test.rb index 6cc499d74..9ba3c64c1 100644 --- a/test/unit/recurring_logic_test.rb +++ b/test/unit/recurring_logic_test.rb @@ -180,24 +180,24 @@ class RecurringLogicsTest < ActiveSupport::TestCase let(:logic) { FactoryBot.build(:recurring_logic) } it 'is valid by default' do - assert logic.valid? + assert_predicate logic, :valid? end it 'is invalid when end time in past' do logic.end_time = (Time.zone.now - 120) - assert_not logic.valid? + refute_predicate logic, :valid? end it 'is invalid when iteration limit < 1' do logic.max_iteration = 0 - assert_not logic.valid? + refute_predicate logic, :valid? end it 'is valid when in active state' do logic.end_time = (Time.zone.now - 120) - assert_not logic.valid? + refute_predicate logic, :valid? logic.state = 'active' - assert logic.valid? + assert_predicate logic, :valid? end end end diff --git a/test/unit/task_test.rb b/test/unit/task_test.rb index 0ed4d55f9..55fa52904 100644 --- a/test/unit/task_test.rb +++ b/test/unit/task_test.rb @@ -284,10 +284,10 @@ class TasksTest < ActiveSupport::TestCase let(:task) { FactoryBot.create(:some_task) } it 'can indicate it is delayed' do - assert_not task.delayed? + refute_predicate task, :delayed? assert_equal 'Immediate', task.execution_type task.start_at = Time.now.utc + 100 - assert task.delayed? + assert_predicate task, :delayed? assert_equal 'Delayed', task.execution_type end end