mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Further minor regressions
This commit is contained in:
@@ -19,7 +19,7 @@ feature 'Home', js: true do
|
||||
it "shows hubs" do
|
||||
page.should have_content distributor.name
|
||||
expand_active_table_node distributor.name
|
||||
page.should have_content "Shop at #{distributor.name}"
|
||||
page.should have_content "OUR PRODUCERS"
|
||||
end
|
||||
|
||||
it "does not show invisible hubs" do
|
||||
|
||||
@@ -43,7 +43,7 @@ module UIComponentHelper
|
||||
end
|
||||
|
||||
def open_enterprise_modal(enterprise)
|
||||
find("a", text: enterprise.name).click
|
||||
find("a", text: enterprise.name).trigger "click"
|
||||
end
|
||||
|
||||
def modal_should_be_open_for(object)
|
||||
@@ -67,6 +67,15 @@ module UIComponentHelper
|
||||
find("#cart").click
|
||||
end
|
||||
|
||||
def wait_for_ajax
|
||||
counter = 0
|
||||
while page.execute_script("return $.active").to_i > 0
|
||||
counter += 1
|
||||
sleep(0.1)
|
||||
raise "AJAX request took longer than 5 seconds." if counter >= 50
|
||||
end
|
||||
end
|
||||
|
||||
def be_logged_in_as(user_or_email)
|
||||
if user_or_email.is_a? Spree::User
|
||||
have_content user_or_email.email
|
||||
|
||||
Reference in New Issue
Block a user