0
0
Fork 0

Remove unneeded settings cleanup from specs (#28425)

This commit is contained in:
Claire 2023-12-19 16:17:22 +01:00 committed by GitHub
parent c7c727994a
commit 6fed0fcbaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 8 additions and 189 deletions

View file

@ -175,16 +175,8 @@ RSpec.describe User do
let(:user) { Fabricate(:user, confirmed_at: nil, unconfirmed_email: new_email) }
context 'when the user is already approved' do
around do |example|
registrations_mode = Setting.registrations_mode
Setting.registrations_mode = 'approved'
example.run
Setting.registrations_mode = registrations_mode
end
before do
Setting.registrations_mode = 'approved'
user.approve!
end
@ -199,13 +191,8 @@ RSpec.describe User do
end
context 'when the user does not require explicit approval' do
around do |example|
registrations_mode = Setting.registrations_mode
before do
Setting.registrations_mode = 'open'
example.run
Setting.registrations_mode = registrations_mode
end
it 'sets email to unconfirmed_email' do
@ -219,13 +206,8 @@ RSpec.describe User do
end
context 'when the user requires explicit approval but is not approved' do
around do |example|
registrations_mode = Setting.registrations_mode
before do
Setting.registrations_mode = 'approved'
example.run
Setting.registrations_mode = registrations_mode
end
it 'sets email to unconfirmed_email' do
@ -243,16 +225,8 @@ RSpec.describe User do
describe '#approve!' do
subject { user.approve! }
around do |example|
registrations_mode = Setting.registrations_mode
Setting.registrations_mode = 'approved'
example.run
Setting.registrations_mode = registrations_mode
end
before do
Setting.registrations_mode = 'approved'
allow(TriggerWebhookWorker).to receive(:perform_async)
end