Further minor regressions

This commit is contained in:
Will Marshall
2014-07-28 13:41:38 +10:00
parent a5f478bde7
commit 9d0919d201
2 changed files with 11 additions and 2 deletions

View File

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

View File

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