about summary refs log tree commit diff
path: root/spec/controllers
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-11-19 17:48:13 +0100
committerGitHub <noreply@github.com>2020-11-19 17:48:13 +0100
commit96c1e7132971877fba308c51cd42306f0b1bf166 (patch)
tree958beaea2865100de42bd7d962f6c7554566e906 /spec/controllers
parent022d2353a77edaddd6a681405521f27f5fac11b2 (diff)
Add import/export feature for bookmarks (#14956)
* Add ability to export bookmarks

* Add support for importing bookmarks

* Add bookmark import tests

* Add bookmarks export test
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/settings/exports/bookmarks_controller_specs.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/controllers/settings/exports/bookmarks_controller_specs.rb b/spec/controllers/settings/exports/bookmarks_controller_specs.rb
new file mode 100644
index 000000000..85761577b
--- /dev/null
+++ b/spec/controllers/settings/exports/bookmarks_controller_specs.rb
@@ -0,0 +1,17 @@
+require 'rails_helper'
+
+describe Settings::Exports::BookmarksController do
+  render_views
+
+  describe 'GET #index' do
+    it 'returns a csv of the bookmarked toots' do
+      user = Fabricate(:user)
+      user.account.bookmarks.create!(status: Fabricate(:status, uri: 'https://foo.bar/statuses/1312'))
+
+      sign_in user, scope: :user
+      get :index, format: :csv
+
+      expect(response.body).to eq "https://foo.bar/statuses/1312\n"
+    end
+  end
+end