mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-16 04:24:23 +00:00
Merge pull request #11891 from bmd08a1/ft/search-by-customer-fullname-with-comma
Allow searching orders by customers' full name with comma and full name reversed
This commit is contained in:
@@ -230,15 +230,63 @@ describe '
|
||||
end
|
||||
|
||||
it "by customer name" do
|
||||
# by firstname
|
||||
fill_in "quick_filter", with: o1.bill_address.firstname
|
||||
page.find('.filter-actions .button.icon-search').click
|
||||
|
||||
expect_line_items_results [li1], [li2, li3]
|
||||
|
||||
# by lastname
|
||||
fill_in "quick_filter", with: o1.bill_address.lastname
|
||||
page.find('.filter-actions .button.icon-search').click
|
||||
|
||||
expect_line_items_results [li1], [li2, li3]
|
||||
|
||||
# by fullname
|
||||
fill_in "quick_filter", with: "#{o1.bill_address.firstname} #{o1.bill_address.lastname}"
|
||||
page.find('.filter-actions .button.icon-search').click
|
||||
|
||||
expect_line_items_results [li1], [li2, li3]
|
||||
|
||||
fill_in "quick_filter", with: "#{o2.bill_address.firstname} #{o2.bill_address.lastname}"
|
||||
page.find('.filter-actions .button.icon-search').click
|
||||
|
||||
expect_line_items_results [li2, li3], [li1]
|
||||
|
||||
# by fullname reversed
|
||||
fill_in "quick_filter", with: "#{o1.bill_address.lastname} #{o1.bill_address.firstname}"
|
||||
page.find('.filter-actions .button.icon-search').click
|
||||
|
||||
expect_line_items_results [li1], [li2, li3]
|
||||
|
||||
fill_in "quick_filter", with: "#{o2.bill_address.lastname} #{o2.bill_address.firstname}"
|
||||
page.find('.filter-actions .button.icon-search').click
|
||||
|
||||
expect_line_items_results [li2, li3], [li1]
|
||||
|
||||
# by fullname with comma
|
||||
fill_in "quick_filter", with: "#{o1.bill_address.firstname}, #{o1.bill_address.lastname}"
|
||||
|
||||
page.find('.filter-actions .button.icon-search').click
|
||||
|
||||
expect_line_items_results [li1], [li2, li3]
|
||||
|
||||
fill_in "quick_filter", with: "#{o2.bill_address.firstname}, #{o2.bill_address.lastname}"
|
||||
page.find('.filter-actions .button.icon-search').click
|
||||
|
||||
expect_line_items_results [li2, li3], [li1]
|
||||
|
||||
# by fullname with comma reversed
|
||||
fill_in "quick_filter", with: "#{o1.bill_address.lastname}, #{o1.bill_address.firstname}"
|
||||
|
||||
page.find('.filter-actions .button.icon-search').click
|
||||
|
||||
expect_line_items_results [li1], [li2, li3]
|
||||
|
||||
fill_in "quick_filter", with: "#{o2.bill_address.lastname}, #{o2.bill_address.firstname}"
|
||||
page.find('.filter-actions .button.icon-search').click
|
||||
|
||||
expect_line_items_results [li2, li3], [li1]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user