about summary refs log tree commit diff
path: root/spec/controllers/settings
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-04-12 12:20:44 -0400
committerEugen <eugen@zeonfederated.com>2017-04-12 18:20:44 +0200
commit7f0a865b05628fa82ac692ec9a21c418e30dac14 (patch)
tree9c6e38bf2a644bcf9aab6f1fdc7f275cb380891a /spec/controllers/settings
parent08fce0821706a3c84b70fd513eb75c0ad7014c04 (diff)
Allow import/export of mutes list (#1541)
* Allow export of mutes list

* Allow importing of mutes list

* Refactor to use Settings::Exports::BaseController and DRY up exports code
Diffstat (limited to 'spec/controllers/settings')
-rw-r--r--spec/controllers/settings/exports/blocked_accounts_controller_spec.rb2
-rw-r--r--spec/controllers/settings/exports/following_accounts_controller_spec.rb2
-rw-r--r--spec/controllers/settings/exports/muted_accounts_controller_spec.rb17
3 files changed, 19 insertions, 2 deletions
diff --git a/spec/controllers/settings/exports/blocked_accounts_controller_spec.rb b/spec/controllers/settings/exports/blocked_accounts_controller_spec.rb
index 574d4d875..c815bdfec 100644
--- a/spec/controllers/settings/exports/blocked_accounts_controller_spec.rb
+++ b/spec/controllers/settings/exports/blocked_accounts_controller_spec.rb
@@ -11,7 +11,7 @@ describe Settings::Exports::BlockedAccountsController do
 
       expect(response).to have_http_status(:success)
       expect(response.content_type).to eq 'text/csv'
-      expect(response.headers['Content-Disposition']).to eq 'attachment; filename="blocking.csv"'
+      expect(response.headers['Content-Disposition']).to eq 'attachment; filename="blocked_accounts.csv"'
     end
   end
 end
diff --git a/spec/controllers/settings/exports/following_accounts_controller_spec.rb b/spec/controllers/settings/exports/following_accounts_controller_spec.rb
index bf7680523..a7029709c 100644
--- a/spec/controllers/settings/exports/following_accounts_controller_spec.rb
+++ b/spec/controllers/settings/exports/following_accounts_controller_spec.rb
@@ -11,7 +11,7 @@ describe Settings::Exports::FollowingAccountsController do
 
       expect(response).to have_http_status(:success)
       expect(response.content_type).to eq 'text/csv'
-      expect(response.headers['Content-Disposition']).to eq 'attachment; filename="following.csv"'
+      expect(response.headers['Content-Disposition']).to eq 'attachment; filename="following_accounts.csv"'
     end
   end
 end
diff --git a/spec/controllers/settings/exports/muted_accounts_controller_spec.rb b/spec/controllers/settings/exports/muted_accounts_controller_spec.rb
new file mode 100644
index 000000000..bb52b6fcf
--- /dev/null
+++ b/spec/controllers/settings/exports/muted_accounts_controller_spec.rb
@@ -0,0 +1,17 @@
+require 'rails_helper'
+
+describe Settings::Exports::MutedAccountsController do
+  before do
+    sign_in Fabricate(:user), scope: :user
+  end
+
+  describe 'GET #index' do
+    it 'returns a csv of the muting accounts' do
+      get :index, format: :csv
+
+      expect(response).to have_http_status(:success)
+      expect(response.content_type).to eq 'text/csv'
+      expect(response.headers['Content-Disposition']).to eq 'attachment; filename="muted_accounts.csv"'
+    end
+  end
+end