about summary refs log tree commit diff
path: root/spec/controllers/settings/exports/bookmarks_controller_spec.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-03-28 12:43:58 +0200
committerGitHub <noreply@github.com>2022-03-28 12:43:58 +0200
commit30658924a80434e6a2bceb61267b911ea8d37898 (patch)
tree2b461a8191e566a06370682c9e872d329beb7fa4 /spec/controllers/settings/exports/bookmarks_controller_spec.rb
parent56edc6552f71a1f58fd8ca5ea2f0603015be0c2c (diff)
Fix test-related issues (#17888)
* Remove obsolete RSS::Serializer test

Since #17828, RSS::Serializer no longer has specific code for deleted statuses,
but it is never called on deleted statuses anyway.

* Rename erroneously-named test files

* Fix failing test

* Fix test deprecation warnings

* Update CircleCI Ruby orb

1.4.0 has a bug that does not match all the test files due to incorrect
globbing
Diffstat (limited to 'spec/controllers/settings/exports/bookmarks_controller_spec.rb')
-rw-r--r--spec/controllers/settings/exports/bookmarks_controller_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/controllers/settings/exports/bookmarks_controller_spec.rb b/spec/controllers/settings/exports/bookmarks_controller_spec.rb
new file mode 100644
index 000000000..a06c02e0c
--- /dev/null
+++ b/spec/controllers/settings/exports/bookmarks_controller_spec.rb
@@ -0,0 +1,22 @@
+require 'rails_helper'
+
+describe Settings::Exports::BookmarksController do
+  render_views
+
+  let(:user)    { Fabricate(:user) }
+  let(:account) { Fabricate(:account, domain: 'foo.bar') }
+  let(:status)  { Fabricate(:status, account: account, uri: 'https://foo.bar/statuses/1312') }
+
+  describe 'GET #index' do
+    before do
+      user.account.bookmarks.create!(status: status)
+    end
+
+    it 'returns a csv of the bookmarked toots' do
+      sign_in user, scope: :user
+      get :index, format: :csv
+
+      expect(response.body).to eq "https://foo.bar/statuses/1312\n"
+    end
+  end
+end