summaryrefslogtreecommitdiff
path: root/spec/models/concerns/schedulable_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/concerns/schedulable_spec.rb')
-rw-r--r--spec/models/concerns/schedulable_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/concerns/schedulable_spec.rb b/spec/models/concerns/schedulable_spec.rb
index 62acd12e267..b98dcf1c174 100644
--- a/spec/models/concerns/schedulable_spec.rb
+++ b/spec/models/concerns/schedulable_spec.rb
@@ -57,6 +57,16 @@ RSpec.describe Schedulable do
it_behaves_like '.runnable_schedules'
end
+ context 'for a packages cleanup policy' do
+ # let! is used to reset the next_run_at value before each spec
+ let(:object) { create(:packages_cleanup_policy, :runnable) }
+ let(:non_runnable_object) { create(:packages_cleanup_policy) }
+
+ it_behaves_like '#schedule_next_run!'
+ it_behaves_like 'before_save callback'
+ it_behaves_like '.runnable_schedules'
+ end
+
describe '#next_run_at' do
let(:schedulable_instance) do
Class.new(ActiveRecord::Base) do