Skip to content

Url Helpers in integration tests don't respect RAILS_RELATIVE_URL_ROOT #8480

Closed
dugsmith opened this Issue Dec 10, 2012 · 1 comment

2 participants

@dugsmith

When running integration tests like this:

$ RAILS_RELATIVE_URL_ROOT='/myapp' rspec spec/requests

URL helpers used in tests to navigate or confirm correct urls ignore RAILS_RELATIVE_URL_ROOT. I discussed this at #5122 here and here. This testing issue is a subset of the other issues raised there. I will be submitting a tested pull request for this issue.

@dugsmith dugsmith added a commit to dugsmith/rails that referenced this issue Dec 11, 2012
@dugsmith dugsmith Fix relative_url_root in integration tests (#8480)
Previously, url helpers in integration tests ignored RAILS_RELATIVE_URL_ROOT, so
even though the app worked, test code would not use the relative_url_root
in url helpers.

Before:
    when running a test like this:
        $ RAILS_RELATIVE_URL_ROOT='/context' rake test

    tests with code like this:
        assert_equal "http://relfoo.com/context/foo", rel_foos_url

    would fail like this:
        <"http://relbar.com/context/foo"> expected but was <"http://relbar.com/foo">.

After:
    Tests pass, yay! :-)
c50f00d
@rafaelfranca
Ruby on Rails member

Closing in favor of #8489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.