moon') create(:album, title: 'Dark Magus') create(:album, title: 'Jimi: Blues') end visit '/search' fill_in 'Search', with: 'Dark' click_button 'Submit' wait_limit = 5 start_time = Time.now until done do raise TimeoutError if (Time.now - start_time) > wait_limit done = page.has_content?('Here are your results') sleep(0.1) end page.should have_content('Dark side of the moon')