diff options
author | ThibG <thib@sitedethib.com> | 2020-03-22 17:59:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-22 17:59:47 +0100 |
commit | d101438b9d1bd827c191605cb21d58f83de2124d (patch) | |
tree | b36d73f45175add7aa114bb42fca5a528a9b24a4 /spec/controllers | |
parent | 7115b0b8c99b7e88aee264be75945e592dec33e4 (diff) | |
parent | 9da4bd098cac88c3e44157765adcff01445ba31a (diff) |
Merge pull request #1305 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/admin/reports_controller_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/controllers/admin/reports_controller_spec.rb b/spec/controllers/admin/reports_controller_spec.rb index b428299ee..49d3e9707 100644 --- a/spec/controllers/admin/reports_controller_spec.rb +++ b/spec/controllers/admin/reports_controller_spec.rb @@ -46,6 +46,26 @@ describe Admin::ReportsController do end end + describe 'POST #resolve' do + it 'resolves the report' do + report = Fabricate(:report) + + put :resolve, params: { id: report } + expect(response).to redirect_to(admin_reports_path) + report.reload + expect(report.action_taken_by_account).to eq user.account + expect(report.action_taken).to eq true + end + + it 'sets trust level when the report is an antispam one' do + report = Fabricate(:report, account: Account.representative) + + put :resolve, params: { id: report } + report.reload + expect(report.target_account.trust_level).to eq Account::TRUST_LEVELS[:trusted] + end + end + describe 'POST #reopen' do it 'reopens the report' do report = Fabricate(:report) |