bookmarks_controller_spec.rb 618 B

123456789101112131415161718192021222324
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe Settings::Exports::BookmarksController do
  4. render_views
  5. let(:user) { Fabricate(:user) }
  6. let(:account) { Fabricate(:account, domain: 'foo.bar') }
  7. let(:status) { Fabricate(:status, account: account, uri: 'https://foo.bar/statuses/1312') }
  8. describe 'GET #index' do
  9. before do
  10. user.account.bookmarks.create!(status: status)
  11. end
  12. it 'returns a csv of the bookmarked toots' do
  13. sign_in user, scope: :user
  14. get :index, format: :csv
  15. expect(response.body).to eq "https://foo.bar/statuses/1312\n"
  16. end
  17. end
  18. end