Add account migration UI (#11846)
Fix #10736 - Change data export to be available for non-functional accounts - Change non-functional accounts to include redirecting accounts
This commit is contained in:
parent
b6df9c1067
commit
3ed94dcc1a
31 changed files with 542 additions and 73 deletions
|
@ -21,6 +21,7 @@ describe Settings::MigrationsController do
|
|||
|
||||
let(:user) { Fabricate(:user, account: account) }
|
||||
let(:account) { Fabricate(:account, moved_to_account: moved_to_account) }
|
||||
|
||||
before { sign_in user, scope: :user }
|
||||
|
||||
context 'when user does not have moved to account' do
|
||||
|
@ -32,7 +33,7 @@ describe Settings::MigrationsController do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when user does not have moved to account' do
|
||||
context 'when user has a moved to account' do
|
||||
let(:moved_to_account) { Fabricate(:account) }
|
||||
|
||||
it 'renders show page' do
|
||||
|
@ -43,21 +44,22 @@ describe Settings::MigrationsController do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'PUT #update' do
|
||||
describe 'POST #create' do
|
||||
context 'when user is not sign in' do
|
||||
subject { put :update }
|
||||
subject { post :create }
|
||||
|
||||
it_behaves_like 'authenticate user'
|
||||
end
|
||||
|
||||
context 'when user is sign in' do
|
||||
subject { put :update, params: { migration: { acct: acct } } }
|
||||
subject { post :create, params: { account_migration: { acct: acct, current_password: '12345678' } } }
|
||||
|
||||
let(:user) { Fabricate(:user, password: '12345678') }
|
||||
|
||||
let(:user) { Fabricate(:user) }
|
||||
before { sign_in user, scope: :user }
|
||||
|
||||
context 'when migration account is changed' do
|
||||
let(:acct) { Fabricate(:account) }
|
||||
let(:acct) { Fabricate(:account, also_known_as: [ActivityPub::TagManager.instance.uri_for(user.account)]) }
|
||||
|
||||
it 'updates moved to account' do
|
||||
is_expected.to redirect_to settings_migration_path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue