Merge remote-tracking branch 'parent/main' into upstream-20240716

This commit is contained in:
KMY 2024-07-16 09:01:12 +09:00
commit adee1645a3
203 changed files with 1707 additions and 1067 deletions

View file

@ -34,7 +34,7 @@ RSpec.describe Admin::Disputes::AppealsController do
let(:current_user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
it 'redirects back to the strike page and notifies target account about approved appeal', :sidekiq_inline do
it 'redirects back to the strike page and notifies target account about approved appeal', :inline_jobs do
emails = capture_emails { subject }
expect(response)
@ -58,7 +58,7 @@ RSpec.describe Admin::Disputes::AppealsController do
let(:current_user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
it 'redirects back to the strike page and notifies target account about rejected appeal', :sidekiq_inline do
it 'redirects back to the strike page and notifies target account about rejected appeal', :inline_jobs do
emails = capture_emails { subject }
expect(response)

View file

@ -176,7 +176,7 @@ RSpec.describe Admin::DomainBlocksController do
end
end
describe 'PUT #update', :sidekiq_inline do
describe 'PUT #update', :inline_jobs do
subject do
post :update, params: { :id => domain_block.id, :domain_block => { domain: 'example.com', severity: new_severity }, 'confirm' => '' }
end

View file

@ -13,7 +13,7 @@ describe Admin::ResetsController do
sign_in Fabricate(:user, role: UserRole.find_by(name: 'Admin')), scope: :user
end
describe 'POST #create', :sidekiq_inline do
describe 'POST #create', :inline_jobs do
it 'redirects to admin accounts page' do
emails = capture_emails { subject }

View file

@ -123,7 +123,7 @@ RSpec.describe Auth::SessionsController do
user.update(current_sign_in_at: 1.month.ago)
end
it 'logs the user in and sends suspicious email and redirects home', :sidekiq_inline do
it 'logs the user in and sends suspicious email and redirects home', :inline_jobs do
emails = capture_emails { subject }
expect(response)
@ -263,7 +263,7 @@ RSpec.describe Auth::SessionsController do
travel_to '2023-12-20T10:00:00Z'
end
it 'does not log the user in, sets a flash message, and sends a suspicious sign in email', :sidekiq_inline do
it 'does not log the user in, sets a flash message, and sends a suspicious sign in email', :inline_jobs do
emails = capture_emails do
Auth::SessionsController::MAX_2FA_ATTEMPTS_PER_HOUR.times do
post :create, params: { user: { otp_attempt: '1234' } }, session: { attempt_user_id: user.id, attempt_user_updated_at: user.updated_at.to_s }

View file

@ -75,7 +75,7 @@ describe UserTrackingConcern do
expect(redis.ttl("account:#{user.account_id}:regeneration")).to be >= 0
end
it 'regenerates feed when sign in is older than two weeks', :sidekiq_inline do
it 'regenerates feed when sign in is older than two weeks', :inline_jobs do
get :show
expect_updated_sign_in_at(user)

View file

@ -17,7 +17,7 @@ RSpec.describe Disputes::AppealsController do
let(:strike) { Fabricate(:account_warning, target_account: current_user.account) }
let(:params) { { strike_id: strike.id, appeal: { text: 'Foo' } } }
it 'notifies staff about new appeal and redirects back to strike page', :sidekiq_inline do
it 'notifies staff about new appeal and redirects back to strike page', :inline_jobs do
emails = capture_emails { subject }
expect(emails.size)
@ -36,7 +36,7 @@ RSpec.describe Disputes::AppealsController do
let(:strike) { Fabricate(:account_warning, target_account: current_user.account) }
let(:params) { { strike_id: strike.id, appeal: { text: '' } } }
it 'does not send email and renders strike show page', :sidekiq_inline do
it 'does not send email and renders strike show page', :inline_jobs do
emails = capture_emails { subject }
expect(emails).to be_empty

View file

@ -69,19 +69,16 @@ describe InvitesController do
end
end
describe 'DELETE #create' do
describe 'DELETE #destroy' do
subject { delete :destroy, params: { id: invite.id } }
let(:invite) { Fabricate(:invite, user: user, expires_at: nil) }
before do
delete :destroy, params: { id: invite.id }
end
it 'redirects' do
expect(response).to redirect_to invites_path
end
it 'expires invite' do
expect(invite.reload).to be_expired
it 'expires invite and redirects' do
expect { subject }
.to(change { invite.reload.expired? }.to(true))
expect(response)
.to redirect_to invites_path
end
end
end

View file

@ -50,7 +50,7 @@ describe Settings::DeletesController do
delete :destroy, params: { form_delete_confirmation: { password: 'petsmoldoggos' } }
end
it 'removes user record and redirects', :aggregate_failures, :sidekiq_inline do
it 'removes user record and redirects', :aggregate_failures, :inline_jobs do
expect(response).to redirect_to '/auth/sign_in'
expect(User.find_by(id: user.id)).to be_nil
expect(user.account.reload).to be_suspended