1
0
Fork 0
forked from gitea/nas

Change registrations to be disabled by default for new servers (#29280)

This commit is contained in:
Claire 2024-02-22 14:28:19 +01:00 committed by KMY
parent 69acc5ebbe
commit 38c91aeff7
6 changed files with 23 additions and 2 deletions

View file

@ -25,6 +25,12 @@ RSpec.configure do |config|
config.before :suite do
Rails.application.load_seed
Chewy.strategy(:bypass)
# NOTE: we switched registrations mode to closed by default, but the specs
# very heavily rely on having it enabled by default, as it relies on users
# being approved by default except in select cases where explicitly testing
# other registration modes
Setting.registrations_mode = 'open'
end
config.after :suite do

View file

@ -102,6 +102,13 @@ RSpec.configure do |config|
self.use_transactional_tests = false
DatabaseCleaner.cleaning do
# NOTE: we switched registrations mode to closed by default, but the specs
# very heavily rely on having it enabled by default, as it relies on users
# being approved by default except in select cases where explicitly testing
# other registration modes
# Also needs to be set per-example here because of the database cleaner.
Setting.registrations_mode = 'open'
example.run
end