Skip to content

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.rb
index 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 do
describe "first admin user" do
before 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]"])
end
it "makes the user into an admin if their email is in DISCOURSE_DEVELOPER_EMAILS" do