mirror of
https://github.com/discourse/discourse.git
synced 2025-03-28 09:45:41 +08:00
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.
This commit is contained in:
parent
c94a2bc69b
commit
7e9da812ea
@ -210,13 +210,18 @@ RSpec.configure do |config|
|
|||||||
# force a rollback after using a multisite connection.
|
# force a rollback after using a multisite connection.
|
||||||
def test_multisite_connection(name)
|
def test_multisite_connection(name)
|
||||||
RailsMultisite::ConnectionManagement.with_connection(name) do
|
RailsMultisite::ConnectionManagement.with_connection(name) do
|
||||||
|
spec_exception = nil
|
||||||
|
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
begin
|
begin
|
||||||
yield
|
yield
|
||||||
|
rescue Exception => spec_exception
|
||||||
ensure
|
ensure
|
||||||
throw raise ActiveRecord::Rollback
|
raise ActiveRecord::Rollback
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
raise spec_exception if spec_exception
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user