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 7971507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:39:19+00:00 2026-06-04T07:39:19+00:00

Here’s a test case that I’m working on: it should allow you to login

  • 0

Here’s a test case that I’m working on:

    it "should allow you to login" do
    visit "/"
    fill_in 'Email', :with => 'user@example.org'
    fill_in 'Pass', :with => 'password'
    click_button 'Login'
    current_url.should =~ /dashboard/
end

This particular test is failing. What I’d like to know is if it’s failing because it’s not able to log in, but failing because I’m checking the current_url too fast. What’s the proper way of ‘waiting’ until the click_button task executes and rails redirects the user?

  • 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-06-04T07:39:20+00:00Added an answer on June 4, 2026 at 7:39 am

    Have you tried manually going to your home page, logging in with those credentials, and then seeing what happens? If you’re able to do it, then you’re able to rule out the idea of it not working.

    I would suggest using the built in assertions instead of matching on the name of the URL. Like so:

    assert_response(:redirect)
    assert_redirected_to(dashboard_path)
    

    You won’t have to wait for your button to click, in either case.

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

Sidebar

Related Questions

Here is a scenario: User installs .NET application that you have made. After some
Here's the flow that I am trying to achieve: 1) User uploads an audio
Here is a sample of text that I’m working with: Word1 Word2 ... Word4
Here is my powershell code for adding test user accounts to Active directory... Problem:
Here is the problem that I am trying to solve. I have two folders
Here is a code snippet I was working with: int *a; int p =
Here is my persistence.xml : <?xml version=1.0 encoding=UTF-8?> <persistence xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd version=1.0>
Here is an example. foreach (var doc in documents) { var processor = this.factory.Create();
Here is an example: I write html code inside of textarea, then I swap
Here's what I'm trying to accomplish with this program: a recursive method that checks

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.