mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-06 01:41:08 +00:00
Relax hard-coded attr names in system specs (#35903)
This commit is contained in:
parent
4738a18e52
commit
4f41b7c089
|
@ -53,8 +53,8 @@ RSpec.describe 'Filters' do
|
||||||
click_on filter_title
|
click_on filter_title
|
||||||
|
|
||||||
fill_in filter_title_field, with: new_title
|
fill_in filter_title_field, with: new_title
|
||||||
fill_in 'custom_filter_keywords_attributes_0_keyword', with: 'New value'
|
custom_filter_keywords_fields.first.fill_in with: 'New value'
|
||||||
fill_in 'custom_filter_keywords_attributes_1_keyword', with: 'Wilderness'
|
custom_filter_keywords_fields.last.fill_in with: 'Wilderness'
|
||||||
|
|
||||||
expect { click_on submit_button }
|
expect { click_on submit_button }
|
||||||
.to change { keyword_one.reload.keyword }.to(/New value/)
|
.to change { keyword_one.reload.keyword }.to(/New value/)
|
||||||
|
@ -107,6 +107,10 @@ RSpec.describe 'Filters' do
|
||||||
click_on I18n.t('filters.new.save')
|
click_on I18n.t('filters.new.save')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def custom_filter_keywords_fields
|
||||||
|
page.all('.keywords-table .custom_filter_keywords_keyword')
|
||||||
|
end
|
||||||
|
|
||||||
def filter_title_field
|
def filter_title_field
|
||||||
form_label('defaults.title')
|
form_label('defaults.title')
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,11 +23,11 @@ RSpec.describe 'Profile' do
|
||||||
fill_in 'Display name', with: 'Bob'
|
fill_in 'Display name', with: 'Bob'
|
||||||
fill_in 'Bio', with: 'Bob is silent'
|
fill_in 'Bio', with: 'Bob is silent'
|
||||||
|
|
||||||
fill_in 'account_fields_attributes_0_name', with: 'Personal Website'
|
account_fields_labels.first.fill_in with: 'Personal Website'
|
||||||
fill_in 'account_fields_attributes_0_value', with: 'https://host.example/personal'
|
account_fields_values.first.fill_in with: 'https://host.example/personal'
|
||||||
|
|
||||||
fill_in 'account_fields_attributes_1_name', with: 'Professional Biography'
|
account_fields_labels.last.fill_in with: 'Professional Biography'
|
||||||
fill_in 'account_fields_attributes_1_value', with: 'https://host.example/pro'
|
account_fields_values.last.fill_in with: 'https://host.example/pro'
|
||||||
|
|
||||||
expect { submit_form }
|
expect { submit_form }
|
||||||
.to change { bob.account.reload.display_name }.to('Bob')
|
.to change { bob.account.reload.display_name }.to('Bob')
|
||||||
|
@ -40,6 +40,14 @@ RSpec.describe 'Profile' do
|
||||||
first('button[type=submit]').click
|
first('button[type=submit]').click
|
||||||
end
|
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
|
def change_account_fields
|
||||||
change { bob.account.reload.fields }
|
change { bob.account.reload.fields }
|
||||||
.from([])
|
.from([])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user