0
0
Fork 0

Merge branch 'main' into glitch-soc/merge-upstream

This commit is contained in:
Claire 2022-03-28 16:22:28 +02:00
commit f313bf3e97
24 changed files with 100 additions and 112 deletions

View file

@ -194,9 +194,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
end
describe 'POST #unblock_email' do
subject do
-> { post :unblock_email, params: { id: account.id } }
end
subject { post :unblock_email, params: { id: account.id } }
let(:current_user) { Fabricate(:user, admin: admin) }
let(:account) { Fabricate(:account, suspended: true) }
@ -206,11 +204,11 @@ RSpec.describe Admin::AccountsController, type: :controller do
let(:admin) { true }
it 'succeeds in removing email blocks' do
is_expected.to change { CanonicalEmailBlock.where(reference_account: account).count }.from(1).to(0)
expect { subject }.to change { CanonicalEmailBlock.where(reference_account: account).count }.from(1).to(0)
end
it 'redirects to admin account path' do
subject.call
subject
expect(response).to redirect_to admin_account_path(account.id)
end
end
@ -219,7 +217,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
let(:admin) { false }
it 'fails to remove avatar' do
subject.call
subject
expect(response).to have_http_status :forbidden
end
end

View file

@ -3,11 +3,16 @@ 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'))
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