mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Style/SingleLineDoEndBlock: Prefer multiline do...end block
This commit is contained in:
@@ -158,14 +158,18 @@ describe 'Tag Rules' do
|
||||
|
||||
# DEFAULT FilterShippingMethods rule
|
||||
within ".default_rules #tr_0" do
|
||||
within "li.tag-item", text: "local ✖" do find("a.remove-button").click end
|
||||
within "li.tag-item", text: "local ✖" do
|
||||
find("a.remove-button").click
|
||||
end
|
||||
fill_in_tag "volunteers-only"
|
||||
expect(page).to have_content "not visible"
|
||||
end
|
||||
|
||||
# FilterProducts rule
|
||||
within ".customer_tag #tr_1" do
|
||||
within "li.tag-item", text: "member ✖" do find("a.remove-button").click end
|
||||
within "li.tag-item", text: "member ✖" do
|
||||
find("a.remove-button").click
|
||||
end
|
||||
fill_in_tag "volunteers-only1"
|
||||
expect(page).to have_select2 "enterprise_tag_rules_attributes_1_preferred_matched_" \
|
||||
"variants_visibility", selected: 'VISIBLE'
|
||||
@@ -176,7 +180,9 @@ describe 'Tag Rules' do
|
||||
|
||||
# FilterPaymentMethods rule
|
||||
within ".customer_tag #tr_2" do
|
||||
within "li.tag-item", text: "trusted ✖" do find("a.remove-button").click end
|
||||
within "li.tag-item", text: "trusted ✖" do
|
||||
find("a.remove-button").click
|
||||
end
|
||||
fill_in_tag "volunteers-only2"
|
||||
expect(page).to have_select2 "enterprise_tag_rules_attributes_2_preferred_matched_" \
|
||||
"payment_methods_visibility", selected: 'NOT VISIBLE'
|
||||
@@ -187,7 +193,9 @@ describe 'Tag Rules' do
|
||||
|
||||
# FilterOrderCycles rule
|
||||
within ".customer_tag #tr_3" do
|
||||
within "li.tag-item", text: "wholesale ✖" do find("a.remove-button").click end
|
||||
within "li.tag-item", text: "wholesale ✖" do
|
||||
find("a.remove-button").click
|
||||
end
|
||||
fill_in_tag "volunteers-only3"
|
||||
expect(page).to have_select2 "enterprise_tag_rules_attributes_3_preferred_matched_" \
|
||||
"order_cycles_visibility", selected: 'VISIBLE'
|
||||
@@ -198,7 +206,9 @@ describe 'Tag Rules' do
|
||||
|
||||
# FilterShippingMethods rule
|
||||
within ".customer_tag #tr_4" do
|
||||
within "li.tag-item", text: "local ✖" do find("a.remove-button").click end
|
||||
within "li.tag-item", text: "local ✖" do
|
||||
find("a.remove-button").click
|
||||
end
|
||||
fill_in_tag "volunteers-only4"
|
||||
expect(page).to have_select2 "enterprise_tag_rules_attributes_4_preferred_matched_" \
|
||||
"shipping_methods_visibility", selected: 'NOT VISIBLE'
|
||||
@@ -257,11 +267,15 @@ describe 'Tag Rules' do
|
||||
it "deletes both default and customer rules from the database" do
|
||||
expect do
|
||||
accept_alert do
|
||||
within "#tr_1" do first("a.delete-tag-rule").click end
|
||||
within "#tr_1" do
|
||||
first("a.delete-tag-rule").click
|
||||
end
|
||||
end
|
||||
expect(page).to have_no_selector "#tr_1"
|
||||
accept_alert do
|
||||
within "#tr_0" do first("a.delete-tag-rule").click end
|
||||
within "#tr_0" do
|
||||
first("a.delete-tag-rule").click
|
||||
end
|
||||
end
|
||||
expect(page).to have_no_selector "#tr_0"
|
||||
end.to change{ TagRule.count }.by(-2)
|
||||
|
||||
@@ -131,14 +131,18 @@ describe "
|
||||
toggle_columns "Hide"
|
||||
expect(page).to have_selector "tr#v_#{variant.id}"
|
||||
expect(page).to have_selector "tr#v_#{variant_related.id}"
|
||||
within "tr#v_#{variant.id}" do click_button 'Hide' end
|
||||
within "tr#v_#{variant.id}" do
|
||||
click_button 'Hide'
|
||||
end
|
||||
expect(page).to have_no_selector "tr#v_#{variant.id}"
|
||||
expect(page).to have_selector "tr#v_#{variant_related.id}"
|
||||
first("div#views-dropdown").click
|
||||
first("div#views-dropdown div.menu div.menu_item", text: "Hidden Products").click
|
||||
expect(page).to have_selector "tr#v_#{variant.id}"
|
||||
expect(page).to have_no_selector "tr#v_#{variant_related.id}"
|
||||
within "tr#v_#{variant.id}" do click_button 'Add' end
|
||||
within "tr#v_#{variant.id}" do
|
||||
click_button 'Add'
|
||||
end
|
||||
expect(page).to have_no_selector "tr#v_#{variant.id}"
|
||||
expect(page).to have_no_selector "tr#v_#{variant_related.id}"
|
||||
first("div#views-dropdown").click
|
||||
@@ -492,8 +496,12 @@ describe "
|
||||
expect(page).to have_table_row ['PRODUCER', 'PRODUCT', 'VARIANT', 'ADD', 'HIDE']
|
||||
expect(page).to have_selector "table#new-products tr#v_#{variant1.id}"
|
||||
expect(page).to have_selector "table#new-products tr#v_#{variant2.id}"
|
||||
within "table#new-products tr#v_#{variant1.id}" do click_button 'Add' end
|
||||
within "table#new-products tr#v_#{variant2.id}" do click_button 'Hide' end
|
||||
within "table#new-products tr#v_#{variant1.id}" do
|
||||
click_button 'Add'
|
||||
end
|
||||
within "table#new-products tr#v_#{variant2.id}" do
|
||||
click_button 'Hide'
|
||||
end
|
||||
expect(page).to have_no_selector "table#new-products tr#v_#{variant1.id}"
|
||||
expect(page).to have_no_selector "table#new-products tr#v_#{variant2.id}"
|
||||
click_button "Back to my inventory"
|
||||
|
||||
Reference in New Issue
Block a user