mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-17 00:07:24 +00:00
11058: add get_all_input_values
This commit is contained in:
@@ -34,11 +34,8 @@ describe 'As an enterprise user, I can manage my products', feature: :admin_styl
|
||||
|
||||
it "Should sort products alphabetically by default in ascending order" do
|
||||
within products_table do
|
||||
# Gather input values, because page.content doesn't include them.
|
||||
input_content = page.find_all('input[type=text]').map(&:value).join
|
||||
|
||||
# Products are in correct order.
|
||||
expect(input_content).to match /Apples.*Bananas/
|
||||
expect(all_input_values).to match /Apples.*Bananas/
|
||||
end
|
||||
end
|
||||
|
||||
@@ -50,16 +47,12 @@ describe 'As an enterprise user, I can manage my products', feature: :admin_styl
|
||||
# Sort in descending order
|
||||
name_header.click
|
||||
expect(page).to have_content("Name ▼") # this indicates the re-sorted content has loaded
|
||||
|
||||
input_content = page.find_all('input[type=text]').map(&:value).join
|
||||
expect(input_content).to match /Bananas.*Apples/
|
||||
expect(all_input_values).to match /Bananas.*Apples/
|
||||
|
||||
# Sort in ascending order
|
||||
name_header.click
|
||||
expect(page).to have_content("Name ▲") # this indicates the re-sorted content has loaded
|
||||
|
||||
input_content = page.find_all('input[type=text]').map(&:value).join
|
||||
expect(input_content).to match /Apples.*Bananas/
|
||||
expect(all_input_values).to match /Apples.*Bananas/
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1199,4 +1192,8 @@ describe 'As an enterprise user, I can manage my products', feature: :admin_styl
|
||||
Spree::TaxCategory
|
||||
.pluck(:name).sample
|
||||
end
|
||||
|
||||
def all_input_values
|
||||
page.find_all('input[type=text]').map(&:value).join
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user