You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.0 KiB

  1. require 'rails_helper'
  2. describe Export do
  3. describe 'to_csv' do
  4. before do
  5. one = Account.new(username: 'one', domain: 'local.host')
  6. two = Account.new(username: 'two', domain: 'local.host')
  7. accounts = [one, two]
  8. @account = double(blocking: accounts, muting: accounts, following: accounts)
  9. end
  10. it 'returns a csv of the blocked accounts' do
  11. export = Export.new(@account).to_blocked_accounts_csv
  12. results = export.strip.split
  13. expect(results.size).to eq 2
  14. expect(results.first).to eq 'one@local.host'
  15. end
  16. it 'returns a csv of the muted accounts' do
  17. export = Export.new(@account).to_muted_accounts_csv
  18. results = export.strip.split
  19. expect(results.size).to eq 2
  20. expect(results.first).to eq 'one@local.host'
  21. end
  22. it 'returns a csv of the following accounts' do
  23. export = Export.new(@account).to_following_accounts_csv
  24. results = export.strip.split
  25. expect(results.size).to eq 2
  26. expect(results.first).to eq 'one@local.host'
  27. end
  28. end
  29. end