Skip to content

Commit

Permalink
Abstract part of translation string
Browse files Browse the repository at this point in the history
- Allows string to change without breaking test
- Makes test expectation less magical
  • Loading branch information
JoeCohen committed Jan 13, 2024
1 parent 6a9ea0c commit 7e59e4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions config/locales/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@
removed_from_project: Removed [object] from "[project]".
select_file: Select file...
no_file_selected: No file selected.
SEE_MESSAGE_BELOW: See message below.
"YES": "Yes"
"NO": "No"
"yes": "yes"
Expand Down Expand Up @@ -1642,13 +1643,13 @@
form_observations_collection_number_help: Enter the collector's full name and their record identifier. The identifier can be anything. It's whatever you use to keep track of your specimens, and it is typically written on the specimen label. This is most commonly a sequential number starting at 1 for your first specimen, and working up over your life time. Another common format is a year or date along with a collection number for that date, e.g., "17-034". But it can be anything you like, including letters and punctuation.
form_observations_herbarium_record_help: If you've sent a specimen to a fungarium, you can enter that here, along with their accession number if you know it. Otherwise let it default to your personal fungarium and leave the accession number blank.

form_observations_there_is_a_problem_with_projects: This observation violates the constraints of one or more selected projects. "+See message below.+":#project_messages
form_observations_there_is_a_problem_with_projects: This observation violates the constraints of one or more selected projects. "+[:SEE_MESSAGE_BELOW]+":#project_messages
form_observations_projects_out_of_range: The observation date ([date]) or location ([place_name]) is outside the range of these checked project(s)
form_observations_projects_out_of_range_help: "Either:\n- Uncheck out-of-range projects;\n- Change the observation date or location if it is incorrect; or\n- (undesirably) Check [:form_observations_projects_ignore_project_constraints] to ignore the project constraints.\nThen click [button_name]."
form_observations_projects_ignore_project_constraints: Ignore Project Constraints

form_observations_there_is_a_problem_with_location: There is a problem with the location. "+See message below.+":#location_messages
form_observations_there_is_a_problem_with_name: There is a problem with the name. "+See message below.+":#name_messages
form_observations_there_is_a_problem_with_location: There is a problem with the location. "+[:SEE_MESSAGE_BELOW]+":#location_messages
form_observations_there_is_a_problem_with_name: There is a problem with the name. "+[:SEE_MESSAGE_BELOW]+":#name_messages

# observations/_form_species_list
form_species_lists_title: Title
Expand Down
2 changes: 1 addition & 1 deletion test/integration/capybara/namings_integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_proposing_names
assert_flash_text(:form_naming_what_missing.l, session: namer_session)
namer_session.
# see https://github.com/MushroomObserver/mushroom-observer/issues/1796
assert_no_selector("#flash_notices", text: "See message below")
assert_no_selector("#flash_notices", text: :SEE_MESSAGE_BELOW.l)

namer_session.within("#obs_#{obs.id}_naming_form") do |form|
form.fill_in("naming_name", with: text_name)
Expand Down

0 comments on commit 7e59e4d

Please sign in to comment.