diff options
author | Matteo Aquila <matteoaquila@users.noreply.github.com> | 2017-04-13 15:30:04 +0200 |
---|---|---|
committer | Matteo Aquila <matteoaquila@users.noreply.github.com> | 2017-04-13 15:30:04 +0200 |
commit | aec2458d81c5d1d66dd4e997793693acf6add4f3 (patch) | |
tree | 7c9a26d2281371e4f3b1e3753bbe4f7566674b87 | |
parent | 3f42ad7d1ae9cba04ef76c22136579bdd9127678 (diff) | |
parent | 4fe5e04ea47b187b5578d0c9da23ecbe6c382544 (diff) |
Merge remote-tracking branch 'tootsuite/master'
-rw-r--r-- | spec/models/export_spec.rb | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/spec/models/export_spec.rb b/spec/models/export_spec.rb index 5cc62c266..3ee042fb6 100644 --- a/spec/models/export_spec.rb +++ b/spec/models/export_spec.rb @@ -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 |