Edit Account#public_name
This commit is contained in:
parent
a96c7cfd8a
commit
d489697a50
|
@ -6,6 +6,6 @@ class Settings::ProfilePolicy < ApplicationPolicy
|
|||
end
|
||||
|
||||
def permitted_attributes_for_update
|
||||
%i[username biography]
|
||||
%i[username public_name biography]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :username, required: true %>
|
||||
<%= f.input :public_name %>
|
||||
<%= f.input :biography %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -7,8 +7,9 @@ RSpec.describe 'PATCH/PUT /settings/profile' do
|
|||
|
||||
let :account_attributes do
|
||||
{
|
||||
username: Faker::Internet.username(3..36, %w[_]),
|
||||
biography: Faker::Lorem.paragraph,
|
||||
username: Faker::Internet.username(3..36, %w[_]),
|
||||
public_name: Faker::Name.name,
|
||||
biography: Faker::Lorem.paragraph,
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -36,6 +37,13 @@ RSpec.describe 'PATCH/PUT /settings/profile' do
|
|||
.to(account_attributes[:username])
|
||||
end
|
||||
|
||||
specify do
|
||||
expect { make_request }.to \
|
||||
change { current_account.reload.public_name }
|
||||
.from(current_account.public_name)
|
||||
.to(account_attributes[:public_name])
|
||||
end
|
||||
|
||||
specify do
|
||||
expect { make_request }.to \
|
||||
change { current_account.reload.biography }
|
||||
|
|
Reference in New Issue