Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX release] Fix for URL problem using currentURL() acceptance test helper #11201

Merged
merged 1 commit into from
May 18, 2015

Commits on May 18, 2015

  1. [BUGFIX release] Ensure app booted in visit helper

    Problem:
    
    There are reported cases of the currentURL helper returning an empty
    string after the release of 1.12.
    
    Tests:
    
    The acceptance tests are not currently checking the currentURL after
    using the visit helper. This adds an assertion for the current url after
    each currentRoute assertion - the currentRouteName and currentPath
    helpers are functioning normally and, in these tests, the currentRoute
    is a var set on transition to a new route so there is a need to
    specifically check the url.
    
    Fix:
    
    It turns out that this isn't so much a problem with currentURL as it is
    the visit helper. When the lazy router location work was completed in
    8e130e5 the call to `router.location.setURL()` was moved down in the
    else case after checking for readiness deferrals. The problem seems to be
    a timing issue with the call to setupRouter after the application is
    marked ready. The initialURL, while set, doesn't give us a reliable URL
    during tests.
    
    The call to `app.boot()` ensures the application is booted and ready,
    the important part for this fix is the call to `advanceReadiness` in
    boot - it is there that the router and location are set up.
    
    After the app is booted the call to `setURL` works as expected.
    
    Thanks to @rwjblue for working out the code needed to correct the issue.
    elskwid committed May 18, 2015
    Configuration menu
    Copy the full SHA
    1771aec View commit details
    Browse the repository at this point in the history