disputes_helper_spec.rb 641 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe Admin::DisputesHelper do
  4. describe 'strike_action_label' do
  5. it 'returns html describing the appeal' do
  6. adam = Account.new(username: 'Adam')
  7. becky = Account.new(username: 'Becky')
  8. strike = AccountWarning.new(account: adam, action: :suspend)
  9. appeal = Appeal.new(strike: strike, account: becky)
  10. expected = <<~OUTPUT.strip
  11. <span class="username">Adam</span> suspended <span class="target">Becky</span>'s account
  12. OUTPUT
  13. result = helper.strike_action_label(appeal)
  14. expect(result).to eq(expected)
  15. end
  16. end
  17. end