Context
I've noticed in our code base that we had cases where Interactor was encapsulating more interactors and calling them via .call!. One of the interactors was raising Interactor::Failure exception, but because parent interactor was invoked via .call context .success? was still reporting true.
I believe that is wrong behavior and since .call is not raising exception it at least should return false when .success? is invoked.
Steps to reproduce
class ParentInteractor
include Interactor
def call
InteractorWithError.call!
end
end
class InteractorWithError
include Interactor
def call
raise Interactor::Failure.new('test')
end
end
test 'interactor still reports success after it failed' do
context = ParentInteractor.call
assert context.failure?
assert_not context.success?
end