Skip to content
Snippets Groups Projects
Commit aec2458d authored by Matteo Aquila's avatar Matteo Aquila
Browse files

Merge remote-tracking branch 'tootsuite/master'

parents 3f42ad7d 4fe5e04e
No related branches found
No related tags found
No related merge requests found
......@@ -2,12 +2,32 @@ require 'rails_helper'
describe Export do
describe 'to_csv' do
it 'returns a csv of the accounts' do
before do
one = Account.new(username: 'one', domain: 'local.host')
two = Account.new(username: 'two', domain: 'local.host')
accounts = [one, two]
export = Export.new(accounts).to_csv
@account = double(blocking: accounts, muting: accounts, following: accounts)
end
it 'returns a csv of the blocked accounts' do
export = Export.new(@account).to_blocked_accounts_csv
results = export.strip.split
expect(results.size).to eq 2
expect(results.first).to eq 'one@local.host'
end
it 'returns a csv of the muted accounts' do
export = Export.new(@account).to_muted_accounts_csv
results = export.strip.split
expect(results.size).to eq 2
expect(results.first).to eq 'one@local.host'
end
it 'returns a csv of the following accounts' do
export = Export.new(@account).to_following_accounts_csv
results = export.strip.split
expect(results.size).to eq 2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment