Avoid shadowing ambigous matches in ensure_page_loaded

The old activities frontend was loaded several times and required a
workaround. This is no longer the case.

That statement also shaadowed Capybaras amgigous matches when more than
one activity was showing. We thus test for the first activity.
pull/4945/head
Oliver Günther 8 years ago
parent 0a693c6ce3
commit 573eff244a
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 15
      spec/support/pages/abstract_work_package.rb

@ -75,17 +75,10 @@ module Pages
end
def ensure_page_loaded
tries = 0
begin
find('.work-package-details-activities-activity-contents .user',
text: work_package.journals.last.user.name,
wait: 10)
rescue
# HACK This error may happen since activities are loaded several times
# in the old resource, and may cause a reload.
tries += 1
retry unless tries > 5
end
expect(page).to have_selector('.work-package-details-activities-activity-contents .user',
text: work_package.journals.last.user.name,
minimum: 1,
wait: 10)
end
def expect_attributes(attribute_expectations)

Loading…
Cancel
Save