Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6870503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:41:30+00:00 2026-05-27T03:41:30+00:00

Under Asynchronous Javascript , the capybara README gives the following example of something that

  • 0

Under Asynchronous Javascript, the capybara README gives the following example of something that will wait for Ajax:

page.should have_text('baz')

That’s an RSpec construct, but I’m using Test::Unit + shoulda. What’s the equivalent in Test::Unit/shoulda? This is my code:

assert_equal 'foo', find('.bar').text

The line previous to that triggers an Ajax event. My assertion will succeed if executed after the ajax completes but fails if before. How do I tell it to keep retrying until it either succeeds or exceeds Capybara.default_wait_time ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:41:30+00:00Added an answer on May 27, 2026 at 3:41 am

    The capybara mailing list worked better than Stack Overflow even though it took the moderators over 24 hours to approve my post because of Turkey Day. Here is Jonas Nicklas’ response:

    assert page.has_text?('test')
    

    note that the negative form is:

    assert page.has_no_text?('test')
    

    and NOT:

    assert !page.has_text?('test')
    

    this is WRONG, don’t do this. RSpec nowadays doesn’t have this problem
    anymore, so its safe to do:

    page.should_not have_text('test')
    

    /Jonas

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been under the impression for that JavaScript was always asynchronous. However, I
I am under the impression that the below code should work asynchronously. However, when
Under VS's external tools settings there is a Use Output Window check box that
Under what circumstances might you want to use multiple indirection (that is, a chain
Under what circumstances should I expect memcpys to outperform assignments on modern INTEL/AMD hardware?
I was struggling with getting some asynchronous activity to work under PyGTK, when someone
I have an asynchronous library which is compiled under .NET 3.5, since it's used
I have a User Interface that receives asynchronous notifications from a Service that prompts
I was reading here that synchronous ajax calls in jquery don't time out. Is
We are using an asynchronous HttpHandler in ASP.NET 3.5 under IIS 6, and in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.