Forum: Ruby on Rails in functional test, assert_redirected_to w prefix

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ee0293412faca21e4ebf3326ed9d5f8c?d=identicon&s=25 Kad Kerforn (kadoudal)
on 2009-01-19 17:51
I had to use sub-URI deployment (could not use subdomains..), and when
running my functional tests, I the redirected_to assertion embed the
prefix.. quite normal ;-))

is there a way to stipulate this prefix in the test setup to avoid
hard-coding in all the tests ?

Expected response to be a redirect to <http://test.host/my/page>
but was a redirect to <http://test.host/intranet/my/page>

/intranet being the prefix in this case ..

many thanks for your suggestions

erwin
Ee0293412faca21e4ebf3326ed9d5f8c?d=identicon&s=25 Kad Kerforn (kadoudal)
on 2009-01-20 09:12
Kad Kerforn wrote:
> I had to use sub-URI deployment (could not use subdomains..), and when
> running my functional tests, I the redirected_to assertion embed the
> prefix.. quite normal ;-))
>
> is there a way to stipulate this prefix in the test setup to avoid
> hard-coding in all the tests ?
>
> Expected response to be a redirect to <http://test.host/my/page>
> but was a redirect to <http://test.host/intranet/my/page>
>
> /intranet being the prefix in this case ..
>
> many thanks for your suggestions
>
> erwin

solved it , wrote in my test :
ActionController::Base.relative_url_root = 'intranet'
This topic is locked and can not be replied to.