test/unit/triggering_test.rb in foreman-tasks-2.0.3 vs test/unit/triggering_test.rb in foreman-tasks-3.0.0

- old
+ new

@@ -1,30 +1,30 @@ require 'foreman_tasks_test_helper' class TriggeringTest < ActiveSupport::TestCase describe 'validation' do it 'is valid when immediate' do - FactoryBot.build(:triggering).must_be :valid? + _(FactoryBot.build(:triggering)).must_be :valid? end it 'is validates future execution' do triggering = FactoryBot.build(:triggering, :future) - triggering.must_be :valid? + _(triggering).must_be :valid? triggering.start_before = triggering.start_at - 120 - triggering.wont_be :valid? + _(triggering).wont_be :valid? end it 'is invalid when recurring logic is invalid' do triggering = FactoryBot.build(:triggering, :recurring) - triggering.must_be :valid? + _(triggering).must_be :valid? triggering.recurring_logic.stubs(:valid?).returns(false) - triggering.wont_be :valid? + _(triggering).wont_be :valid? end end it 'cannot have mode set to arbitrary value' do triggering = FactoryBot.build(:triggering) - triggering.must_be :valid? - proc { triggering.mode = 'bogus' }.must_raise ArgumentError - proc { triggering.mode = 27 }.must_raise ArgumentError + _(triggering).must_be :valid? + _ { proc { triggering.mode = 'bogus' } }.must_raise ArgumentError + _ { proc { triggering.mode = 27 } }.must_raise ArgumentError end end