mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix HTML validity and element finding in spec
The fixed partial was used twice on the same page. So the used element id appeared twice on the page which is invalid HTML. It also confused the spec. Now we look at the actually displayed text to select the correct element.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
%tr
|
||||
%th= Spree.t('name')
|
||||
%th= Spree.t('amount')
|
||||
%tbody#order-charges.with-border
|
||||
%tbody.with-border
|
||||
- adjustments.each do |adjustment|
|
||||
- if (adjustment.originator_type != 'Spree::ShippingMethod') && !(adjustment.originator_type == 'Spree::TaxRate' && adjustment.amount == 0)
|
||||
%tr.total
|
||||
|
||||
@@ -267,7 +267,7 @@ feature %q{
|
||||
end
|
||||
|
||||
scenario "shows the order tax adjustments" do
|
||||
within('tbody#order-charges') do
|
||||
within('fieldset', text: 'LINE ITEM ADJUSTMENTS') do
|
||||
expect(page).to have_selector "td", match: :first, text: "Tax 1"
|
||||
expect(page).to have_selector "td.total", text: Spree::Money.new(10)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user