Avoid stubbing Gitlab.config.gitlab.host in the tests
We have this in some of the tests:
allow(Gitlab.config.gitlab).to receive(:host).and_return('www.example.com')
This feels like something wasn't properly setup. I tried to put this but it doesn't work: (test still failed)
Capybara.default_host = "http://#{Gitlab.config.gitlab.host}"
The following discussion from !17676 (merged) should be addressed:
-
@artofhuman commented on a discussion: (+2 comments) It fails because here https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/controllers/sessions_controller.rb#L105
redirect_allowed_to?(redirect_uri)
returns false and referer url not stored. In test env we have config value[2] pry(main)> Gitlab.config.gitlab.host => "localhost"
but in tests host is
example.com