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:
Maikel Linke
2019-04-02 16:50:44 +11:00
parent f630738b2c
commit 500cf925ad
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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