Skip to content

Commit

Permalink
11058: add get_all_input_values
Browse files Browse the repository at this point in the history
  • Loading branch information
chahmedejaz committed May 9, 2024
1 parent b5fe19c commit 8e1218a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions spec/system/admin/products_v3/products_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
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
input_content = get_all_input_values

# Products are in correct order.
expect(input_content).to match /Apples.*Bananas/
Expand All @@ -51,14 +51,14 @@
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
input_content = get_all_input_values
expect(input_content).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
input_content = get_all_input_values
expect(input_content).to match /Apples.*Bananas/
end
end
Expand Down Expand Up @@ -1199,4 +1199,8 @@ def random_tax_category
Spree::TaxCategory
.pluck(:name).sample
end

def get_all_input_values

Check warning on line 1203 in spec/system/admin/products_v3/products_spec.rb

View workflow job for this annotation

GitHub Actions / runner / rubocop

[rubocop] reported by reviewdog 🐶 Do not prefix reader method names with `get_`. Raw Output: spec/system/admin/products_v3/products_spec.rb:1203:7: C: Naming/AccessorMethodName: Do not prefix reader method names with `get_`.
page.find_all('input[type=text]').map(&:value).join
end
end

0 comments on commit 8e1218a

Please sign in to comment.