mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 08:48:53 +00:00
Merge commit '9f218c9924b883207a3463a29314c92032cf06df' into glitch-soc/merge-upstream
This commit is contained in:
21
spec/helpers/admin/disputes_helper_spec.rb
Normal file
21
spec/helpers/admin/disputes_helper_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe Admin::DisputesHelper do
|
||||
describe 'strike_action_label' do
|
||||
it 'returns html describing the appeal' do
|
||||
adam = Account.new(username: 'Adam')
|
||||
becky = Account.new(username: 'Becky')
|
||||
strike = AccountWarning.new(account: adam, action: :suspend)
|
||||
appeal = Appeal.new(strike: strike, account: becky)
|
||||
|
||||
expected = <<~OUTPUT.strip
|
||||
<span class="username">Adam</span> suspended <span class="target">Becky</span>'s account
|
||||
OUTPUT
|
||||
result = helper.strike_action_label(appeal)
|
||||
|
||||
expect(result).to eq(expected)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -158,14 +158,14 @@ describe JsonLdHelper do
|
||||
it 'deems a safe compacting as such' do
|
||||
json['object'].delete('convo')
|
||||
compacted = compact(json)
|
||||
deemed_compatible = patch_for_forwarding!(json, compacted)
|
||||
patch_for_forwarding!(json, compacted)
|
||||
expect(compacted['to']).to eq ['https://www.w3.org/ns/activitystreams#Public']
|
||||
expect(safe_for_forwarding?(json, compacted)).to be true
|
||||
end
|
||||
|
||||
it 'deems an unsafe compacting as such' do
|
||||
compacted = compact(json)
|
||||
deemed_compatible = patch_for_forwarding!(json, compacted)
|
||||
patch_for_forwarding!(json, compacted)
|
||||
expect(compacted['to']).to eq ['https://www.w3.org/ns/activitystreams#Public']
|
||||
expect(safe_for_forwarding?(json, compacted)).to be false
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user