From 00c0539b4167cabb1b4743e1fdfaa8fa52427391 Mon Sep 17 00:00:00 2001 From: Paul Bob Date: Fri, 24 Nov 2023 14:40:07 +0200 Subject: [PATCH] chore: fix actions test --- spec/system/avo/actions_spec.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/spec/system/avo/actions_spec.rb b/spec/system/avo/actions_spec.rb index 36a97a250e..e9203fe621 100644 --- a/spec/system/avo/actions_spec.rb +++ b/spec/system/avo/actions_spec.rb @@ -133,7 +133,7 @@ describe "redirects when no confirmation" do it "redirects to hey page" do - no_confirmation = Sub::DummyAction.no_confirmation + original_dummy_action = Sub::DummyAction.dup Sub::DummyAction.class_eval do self.no_confirmation = true @@ -152,12 +152,8 @@ expect(page).to have_text "hey en" - - Sub::DummyAction.class_eval do - undef_method :redirect_handle - end - - Sub::DummyAction.no_confirmation = no_confirmation + Sub.send(:remove_const, "DummyAction") + Sub.const_set("DummyAction", original_dummy_action) end end # let!(:roles) { { admin: false, manager: false, writer: false } }