|
|
|
|
@ -23,11 +23,11 @@ RSpec.describe 'Profile' do
|
|
|
|
|
fill_in 'Display name', with: 'Bob'
|
|
|
|
|
fill_in 'Bio', with: 'Bob is silent'
|
|
|
|
|
|
|
|
|
|
fill_in 'account_fields_attributes_0_name', with: 'Personal Website'
|
|
|
|
|
fill_in 'account_fields_attributes_0_value', with: 'https://host.example/personal'
|
|
|
|
|
account_fields_labels.first.fill_in with: 'Personal Website'
|
|
|
|
|
account_fields_values.first.fill_in with: 'https://host.example/personal'
|
|
|
|
|
|
|
|
|
|
fill_in 'account_fields_attributes_1_name', with: 'Professional Biography'
|
|
|
|
|
fill_in 'account_fields_attributes_1_value', with: 'https://host.example/pro'
|
|
|
|
|
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')
|
|
|
|
|
@ -40,6 +40,14 @@ RSpec.describe 'Profile' do
|
|
|
|
|
first('button[type=submit]').click
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def account_fields_labels
|
|
|
|
|
page.all('.account_fields_name input')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def account_fields_values
|
|
|
|
|
page.all('.account_fields_value input')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def change_account_fields
|
|
|
|
|
change { bob.account.reload.fields }
|
|
|
|
|
.from([])
|
|
|
|
|
|