diff --git a/app/components/admin/custom_fields/edit_form_header_component.rb b/app/components/admin/custom_fields/edit_form_header_component.rb index 796fd5051b99..15c3d514a867 100644 --- a/app/components/admin/custom_fields/edit_form_header_component.rb +++ b/app/components/admin/custom_fields/edit_form_header_component.rb @@ -67,7 +67,7 @@ def tabs { name: "attribute_help_text", path: attribute_help_text_custom_field_path(@custom_field), - label: AttributeHelpText.human_plural_model_name + label: AttributeHelpText.human_attribute_name(:help_text) } end diff --git a/app/components/settings/project_custom_fields/edit_form_header_component.rb b/app/components/settings/project_custom_fields/edit_form_header_component.rb index 9ca9bb1410ae..331fa5f2a1fe 100644 --- a/app/components/settings/project_custom_fields/edit_form_header_component.rb +++ b/app/components/settings/project_custom_fields/edit_form_header_component.rb @@ -72,7 +72,7 @@ def tabs { name: "attribute_help_text", path: attribute_help_text_admin_settings_project_custom_field_path(@custom_field), - label: AttributeHelpText.human_plural_model_name + label: AttributeHelpText.human_attribute_name(:help_text) } tabs diff --git a/spec/features/admin/settings/project_custom_fields/attribute_help_text_spec.rb b/spec/features/admin/settings/project_custom_fields/attribute_help_text_spec.rb index 6d06a17381ee..4d287b19a14a 100644 --- a/spec/features/admin/settings/project_custom_fields/attribute_help_text_spec.rb +++ b/spec/features/admin/settings/project_custom_fields/attribute_help_text_spec.rb @@ -31,6 +31,8 @@ require "spec_helper" RSpec.describe "Project custom field attribute help text", :js do + include Flash::Expectations + shared_let(:admin) { create(:admin) } shared_let(:project_custom_field_section) { create(:project_custom_field_section) } shared_let(:project_custom_field) do @@ -52,7 +54,7 @@ visit edit_admin_settings_project_custom_field_path(project_custom_field) # Navigate to attribute help text tab - click_on AttributeHelpText.human_plural_model_name + click_on AttributeHelpText.human_attribute_name(:help_text) expect(page).to have_current_path( attribute_help_text_admin_settings_project_custom_field_path(project_custom_field) @@ -176,7 +178,7 @@ visit edit_admin_settings_project_custom_field_path(project_custom_field) # Navigate to attribute help text tab - click_on AttributeHelpText.human_plural_model_name + click_on AttributeHelpText.human_attribute_name(:help_text) expect(page).to have_current_path( attribute_help_text_admin_settings_project_custom_field_path(project_custom_field) @@ -190,7 +192,7 @@ ) # Navigate back to attribute help text tab - click_on AttributeHelpText.human_plural_model_name + click_on AttributeHelpText.human_attribute_name(:help_text) expect(page).to have_current_path( attribute_help_text_admin_settings_project_custom_field_path(project_custom_field) @@ -201,9 +203,9 @@ describe "help text display uniqueness" do it "creates separate help texts for different custom fields" do other_custom_field = create(:project_custom_field, - name: "Project Priority", - field_format: "text", - project_custom_field_section:) + name: "Project Priority", + field_format: "text", + project_custom_field_section:) # Create help text for first custom field visit attribute_help_text_admin_settings_project_custom_field_path(project_custom_field) @@ -211,12 +213,16 @@ editor.set_markdown("Help for rating") click_button "Save" + expect_and_dismiss_flash(message: "Successful update") + # Create help text for second custom field visit attribute_help_text_admin_settings_project_custom_field_path(other_custom_field) fill_in "Caption", with: "Priority help" editor.set_markdown("Help for priority") click_button "Save" + expect_and_dismiss_flash(message: "Successful update") + # Verify both help texts exist and are different rating_help = AttributeHelpText::Project.find_by( attribute_name: "custom_field_#{project_custom_field.id}"