A platform for community discussion. Free, open, simple.
DEV: Avoid configuring Rails configuration in tests (#18499)
Alan Guo Xiang Tanf3392a5a8111
diff --git a/spec/lib/auth/default_current_user_provider_spec.rb b/spec/lib/auth/default_current_user_provider_spec.rbindex 74c45f21f53..9c542e7965a 100644--- a/spec/lib/auth/default_current_user_provider_spec.rb+++ b/spec/lib/auth/default_current_user_provider_spec.rb@@ -797,8 +797,8 @@ RSpec.describe Auth::DefaultCurrentUserProvider dodescribe "first admin user" dobefore do- user.update(admin: false, email: "[email protected]")- Rails.configuration.developer_emails = "[email protected]"+ user.update!(admin: false, email: "[email protected]")+ Rails.configuration.stubs(:developer_emails).returns(["[email protected]"])endit "makes the user into an admin if their email is in DISCOURSE_DEVELOPER_EMAILS" do