diff --git a/lib/use_case/report/create.rb b/lib/use_case/report/create.rb index c00cf983..f55b694c 100644 --- a/lib/use_case/report/create.rb +++ b/lib/use_case/report/create.rb @@ -34,7 +34,7 @@ module UseCase end def check_object_exists - raise Errors::NotFound.new("#{object_type.capitalize} not found") unless object + object end def create_report diff --git a/spec/lib/use_case/report/create_spec.rb b/spec/lib/use_case/report/create_spec.rb index 3b9ad990..e10e6865 100644 --- a/spec/lib/use_case/report/create_spec.rb +++ b/spec/lib/use_case/report/create_spec.rb @@ -33,7 +33,7 @@ describe UseCase::Report::Create do shared_examples "object not found" do it "raises an error" do - expect { subject }.to raise_error(Errors::NotFound, "#{object_type.capitalize} not found") + expect { subject }.to raise_error(ActiveRecord::RecordNotFound) end end