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