mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Pluralize admin products search result [OFN-12532]
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#sort
|
||||
%div.pagination-description
|
||||
- if pagy.present?
|
||||
= t(".pagination.total_html", total: pagy.count, from: pagy.from, to: pagy.to)
|
||||
= t(".pagination.total_html", count: pagy.count, from: pagy.from, to: pagy.to)
|
||||
|
||||
- if search_term.present? || producer_id.present? || category_id.present?
|
||||
%a{ href: url_for(page: 1), class: "button disruptive", 'data-turbo-frame': "_self" }
|
||||
|
||||
@@ -878,7 +878,9 @@ en:
|
||||
search: Search
|
||||
sort:
|
||||
pagination:
|
||||
total_html: "<strong>%{total} products</strong> found for your search criteria. Showing %{from} to %{to}."
|
||||
total_html:
|
||||
one: "<strong>%{count} product</strong> found for your search criteria. Showing %{from} to %{to}."
|
||||
other: "<strong>%{count} products</strong> found for your search criteria. Showing %{from} to %{to}."
|
||||
per_page:
|
||||
show: Show
|
||||
per_page: "%{num} per page"
|
||||
|
||||
@@ -186,7 +186,7 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
|
||||
search_for "searchable product"
|
||||
|
||||
expect(page).to have_field "search_term", with: "searchable product"
|
||||
expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1."
|
||||
expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1."
|
||||
expect_products_count_to_be 1
|
||||
end
|
||||
|
||||
@@ -205,7 +205,7 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
|
||||
search_for "searchable product"
|
||||
|
||||
expect(page).to have_field "search_term", with: "searchable product"
|
||||
expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1."
|
||||
expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1."
|
||||
expect_products_count_to_be 1
|
||||
end
|
||||
|
||||
@@ -218,7 +218,7 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
|
||||
search_for "Big box"
|
||||
|
||||
expect(page).to have_field "search_term", with: "Big box"
|
||||
expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1."
|
||||
expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1."
|
||||
expect_products_count_to_be 1
|
||||
end
|
||||
|
||||
@@ -235,7 +235,7 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
|
||||
expect_per_page_to_be 15
|
||||
expect_products_count_to_be 1
|
||||
search_for "searchable product"
|
||||
expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1."
|
||||
expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1."
|
||||
expect_products_count_to_be 1
|
||||
end
|
||||
|
||||
@@ -245,7 +245,7 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
|
||||
|
||||
search_for "searchable product"
|
||||
expect(page).to have_field "search_term", with: "searchable product"
|
||||
expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1."
|
||||
expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1."
|
||||
expect_products_count_to_be 1
|
||||
expect(page).to have_field "Name", with: product_by_name.name
|
||||
|
||||
@@ -315,7 +315,7 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
|
||||
|
||||
search_by_category "Category 1"
|
||||
|
||||
expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1."
|
||||
expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1."
|
||||
expect(page).to have_select "category_id", selected: "Category 1"
|
||||
expect_products_count_to_be 1
|
||||
expect(page).to have_field "Name", with: product_by_category.name
|
||||
|
||||
Reference in New Issue
Block a user