Profile editing: Removes old profile editing page (#38584)
This commit is contained in:
85 files changed
+11
-482
No files matched your search
@@ -17,25 +17,6 @@ RSpec.describe 'Profile' do
|
||||
.to have_title("alice (@alice@#{local_domain_uri.host})")
|
||||
end
|
||||
|
||||
it 'I can change my account' do
|
||||
visit settings_profile_path
|
||||
|
||||
fill_in 'Display name', with: 'Bob'
|
||||
fill_in 'Bio', with: 'Bob is silent'
|
||||
|
||||
account_fields_labels.first.fill_in with: 'Personal Website'
|
||||
account_fields_values.first.fill_in with: 'https://host.example/personal'
|
||||
|
||||
account_fields_labels.last.fill_in with: 'Professional Biography'
|
||||
account_fields_values.last.fill_in with: 'https://host.example/pro'
|
||||
|
||||
expect { submit_form }
|
||||
.to change { bob.account.reload.display_name }.to('Bob')
|
||||
.and(change_account_fields)
|
||||
expect(page)
|
||||
.to have_content 'Changes successfully saved!'
|
||||
end
|
||||
|
||||
def submit_form
|
||||
first('button[type=submit]').click
|
||||
end
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Settings Featured Tags' do
|
||||
let(:user) { Fabricate(:user) }
|
||||
|
||||
before { sign_in(user) }
|
||||
|
||||
describe 'Managing tags' do
|
||||
let(:tag) { Fabricate(:tag) }
|
||||
let(:status) { Fabricate :status, account: user.account }
|
||||
|
||||
before { status.tags << tag }
|
||||
|
||||
it 'Views, adds, and removes featured tags' do
|
||||
visit settings_featured_tags_path
|
||||
|
||||
# Link to existing tag used on a status
|
||||
expect(page.body)
|
||||
.to include(
|
||||
settings_featured_tags_path(featured_tag: { name: tag.name })
|
||||
)
|
||||
|
||||
# Invalid entry
|
||||
fill_in 'featured_tag_name', with: 'test, #foo !bleh'
|
||||
expect { click_on I18n.t('featured_tags.add_new') }
|
||||
.to_not change(user.account.featured_tags, :count)
|
||||
|
||||
# Valid entry
|
||||
fill_in 'featured_tag_name', with: '#friends'
|
||||
expect { click_on I18n.t('featured_tags.add_new') }
|
||||
.to change(user.account.featured_tags, :count).by(1)
|
||||
|
||||
# Delete the created entry
|
||||
expect { click_on I18n.t('filters.index.delete') }
|
||||
.to change(user.account.featured_tags, :count).by(-1)
|
||||
expect(page)
|
||||
.to have_title(I18n.t('settings.featured_tags'))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,36 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Settings profile page' do
|
||||
let(:user) { Fabricate :user }
|
||||
let(:account) { user.account }
|
||||
|
||||
before do
|
||||
sign_in user
|
||||
end
|
||||
|
||||
it 'Views and updates profile information' do
|
||||
visit settings_profile_path
|
||||
|
||||
expect(page)
|
||||
.to have_private_cache_control
|
||||
|
||||
fill_in display_name_field, with: 'New name'
|
||||
attach_file avatar_field, Rails.root.join('spec', 'fixtures', 'files', 'avatar.gif')
|
||||
|
||||
expect { click_on submit_button }
|
||||
.to change { account.reload.display_name }.to('New name')
|
||||
.and(change { account.reload.avatar.instance.avatar_file_name }.from(nil).to(be_present))
|
||||
expect(ActivityPub::UpdateDistributionWorker)
|
||||
.to have_enqueued_sidekiq_job(account.id)
|
||||
end
|
||||
|
||||
def display_name_field
|
||||
form_label('defaults.display_name')
|
||||
end
|
||||
|
||||
def avatar_field
|
||||
form_label('defaults.avatar')
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user