Skip to content

Commit

Permalink
Fix csv export coverage in export spec (mastodon#1691)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski authored and Gargron committed Apr 13, 2017
1 parent a57d30c commit 4fe5e04
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions spec/models/export_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,32 @@

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
Expand Down

0 comments on commit 4fe5e04

Please sign in to comment.