mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 12:44:50 +08:00
DEV: Clean up state to prevent flaky tests (#27397)
When adding custom translations for tests using `I18n.backend.store_translations`, we need to remove the custom translations at the end of each test to prevent the custom translations from leaking to other tests.
This commit is contained in:

committed by
GitHub

parent
1fbc1cd326
commit
8f55cd85ad
@ -5,6 +5,7 @@ describe DiscourseAutomation::AdminAutomationsController do
|
||||
|
||||
before do
|
||||
SiteSetting.discourse_automation_enabled = true
|
||||
|
||||
I18n.backend.store_translations(
|
||||
:en,
|
||||
{
|
||||
@ -24,6 +25,8 @@ describe DiscourseAutomation::AdminAutomationsController do
|
||||
)
|
||||
end
|
||||
|
||||
after { I18n.backend.reload! }
|
||||
|
||||
describe "#show" do
|
||||
context "when logged in as an admin" do
|
||||
before { sign_in(Fabricate(:admin)) }
|
||||
|
Reference in New Issue
Block a user