Merge branch 'master' into glitch-soc/merge-upstream

Conflicts:
- app/models/status.rb
- app/services/remove_status_service.rb
- db/schema.rb

All conflicts were due to the addition of a `deleted_at` attribute
to Statuses and reworked database indexes.
This commit is contained in:
Thibaut Girka
2019-08-29 12:07:50 +02:00
66 changed files with 848 additions and 186 deletions

View File

@ -47,7 +47,7 @@ describe Admin::ReportedStatusesController do
it 'removes a status' do
allow(RemovalWorker).to receive(:perform_async)
subject.call
expect(RemovalWorker).to have_received(:perform_async).with(status_ids.first)
expect(RemovalWorker).to have_received(:perform_async).with(status_ids.first, redraft: false)
end
end

View File

@ -65,7 +65,7 @@ describe Admin::StatusesController do
it 'removes a status' do
allow(RemovalWorker).to receive(:perform_async)
subject.call
expect(RemovalWorker).to have_received(:perform_async).with(status_ids.first)
expect(RemovalWorker).to have_received(:perform_async).with(status_ids.first, redraft: false)
end
end

View File

@ -42,6 +42,6 @@ class UserMailerPreview < ActionMailer::Preview
# Preview this email at http://localhost:3000/rails/mailers/user_mailer/warning
def warning
UserMailer.warning(User.first, AccountWarning.new(text: '', action: :silence))
UserMailer.warning(User.first, AccountWarning.new(text: '', action: :silence), [Status.first.id])
end
end

View File

@ -58,8 +58,8 @@ RSpec.describe Admin::AccountAction, type: :model do
end.to change { Admin::ActionLog.count }.by 1
end
it 'calls queue_email!' do
expect(account_action).to receive(:queue_email!)
it 'calls process_email!' do
expect(account_action).to receive(:process_email!)
subject
end

View File

@ -41,12 +41,12 @@ describe Form::StatusBatch do
it 'call RemovalWorker' do
form.save
expect(RemovalWorker).to have_received(:perform_async).with(status.id)
expect(RemovalWorker).to have_received(:perform_async).with(status.id, redraft: false)
end
it 'do not call RemovalWorker' do
form.save
expect(RemovalWorker).not_to have_received(:perform_async).with(another_status.id)
expect(RemovalWorker).not_to have_received(:perform_async).with(another_status.id, redraft: false)
end
end
end