Skip to content

Commit

Permalink
Finishing touches
Browse files Browse the repository at this point in the history
  • Loading branch information
adamruzicka committed Feb 15, 2024
1 parent 176f381 commit 8ae7859
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/unit/actions/recurring_action_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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!)
Expand Down
10 changes: 5 additions & 5 deletions test/unit/recurring_logic_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
assert_not_predicate logic, :valid?
end

it 'is invalid when iteration limit < 1' do
logic.max_iteration = 0
assert_not logic.valid?
assert_not_predicate logic, :valid?
end

it 'is valid when in active state' do
logic.end_time = (Time.zone.now - 120)
assert_not logic.valid?
assert_not_predicate logic, :valid?
logic.state = 'active'
assert logic.valid?
assert_predicate logic, :valid?
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/unit/task_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
assert_not_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
Expand Down

0 comments on commit 8ae7859

Please sign in to comment.