diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-09-19 20:58:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-19 20:58:19 +0200 |
commit | 3ed94dcc1acf73f1d0d1ab43567b88ee953f57c9 (patch) | |
tree | 3bec67e9d52943779f1b4070556ccab8d64bf6a4 /spec/controllers/settings | |
parent | b6df9c10671cd7bf48de3dbd7a94a92fb0a148ec (diff) |
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
Diffstat (limited to 'spec/controllers/settings')
-rw-r--r-- | spec/controllers/settings/migrations_controller_spec.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/controllers/settings/migrations_controller_spec.rb b/spec/controllers/settings/migrations_controller_spec.rb index 4d814a45e..36e4ba86e 100644 --- a/spec/controllers/settings/migrations_controller_spec.rb +++ b/spec/controllers/settings/migrations_controller_spec.rb @@ -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 |