mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-17 04:13:01 +00:00
501514960a
* Make private toots get PuSHed to subscription URLs that belong to domains where you have approved followers * Authorized followers controller, stub for bulk action * Soft block in the background * Add simple test for new controller * Rename Settings::FollowersController to Settings::FollowerDomainsController, paginate results, rename "private" post setting to "followers-only", fix pagination style, improve post privacy preferences style, improve warning style * Extract compose form warnings into own container, show warning when posting to followers-only with unlocked account
35 lines
917 B
Ruby
35 lines
917 B
Ruby
require 'rails_helper'
|
|
|
|
describe Settings::FollowerDomainsController do
|
|
let(:user) { Fabricate(:user) }
|
|
|
|
before do
|
|
sign_in user, scope: :user
|
|
end
|
|
|
|
describe 'GET #show' do
|
|
it 'returns http success' do
|
|
get :show
|
|
expect(response).to have_http_status(:success)
|
|
end
|
|
end
|
|
|
|
describe 'PATCH #update' do
|
|
let(:poopfeast) { Fabricate(:account, username: 'poopfeast', domain: 'example.com', salmon_url: 'http://example.com/salmon') }
|
|
|
|
before do
|
|
stub_request(:post, 'http://example.com/salmon').to_return(status: 200)
|
|
poopfeast.follow!(user.account)
|
|
patch :update, params: { select: ['example.com'] }
|
|
end
|
|
|
|
it 'redirects back to followers page' do
|
|
expect(response).to redirect_to(settings_follower_domains_path)
|
|
end
|
|
|
|
it 'soft-blocks followers from selected domains' do
|
|
expect(poopfeast.following?(user.account)).to be false
|
|
end
|
|
end
|
|
end
|