mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Simplify spec
What if Zucchini didn't appear at all? Better to test that the two products appear on the same page, in the correct order.
This commit is contained in:
@@ -24,7 +24,7 @@ describe 'As an admin, I can see the new product page' do
|
||||
end
|
||||
|
||||
describe "sorting" do
|
||||
let!(:product_z) { create(:simple_product, name: "zucchini") }
|
||||
let!(:product_z) { create(:simple_product, name: "Bananas") }
|
||||
let!(:product_a) { create(:simple_product, name: "Apples") }
|
||||
|
||||
before do
|
||||
@@ -32,9 +32,7 @@ describe 'As an admin, I can see the new product page' do
|
||||
end
|
||||
|
||||
it "Should sort products alphabetically by default" do
|
||||
expect(page).to have_selector "table.products tbody tr td", text: "Apples"
|
||||
# other products push later one to next page
|
||||
expect(page).not_to have_selector "table.products tbody tr td", text: "zucchini"
|
||||
expect(page).to have_content /Apples.*Bananas/
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user