From 7e9da812eafa807f298312f64bc72b6c6bd7f822 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Thu, 24 Jan 2019 21:36:45 +0100 Subject: [PATCH] DEV: Multisite tests didn't fail anymore The change in 9ba8bfb1aaa46e97874c2d262d561a27750ae1ee swallowed all exceptions (even syntax errors) which made them appear to pass even if they failed. --- spec/rails_helper.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index a2e220225d4..cc0f80b7925 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -210,13 +210,18 @@ RSpec.configure do |config| # force a rollback after using a multisite connection. def test_multisite_connection(name) RailsMultisite::ConnectionManagement.with_connection(name) do + spec_exception = nil + ActiveRecord::Base.transaction do begin yield + rescue Exception => spec_exception ensure - throw raise ActiveRecord::Rollback + raise ActiveRecord::Rollback end end + + raise spec_exception if spec_exception end end