about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/models/export_spec.rb24
-rw-r--r--spec/spec_helper.rb4
2 files changed, 25 insertions, 3 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
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index a5dce977d..7038efce1 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,7 +1,9 @@
 require 'simplecov'
 
 SimpleCov.start 'rails' do
-  add_group "Services", "app/services"
+  add_group 'Services', 'app/services'
+  add_group 'Presenters', 'app/presenters'
+  add_group 'Validators', 'app/validators'
 end
 
 RSpec.configure do |config|