Use a custom subdomain in an integration test
In an integration test ActionDispatch::IntegrationTest, you are not using Capybara, so you can't use Capybara.app_host=, but you can use the host! method to change the host url_for uses:
class MyTest < ActionDispatch::IntegrationTest
def setup
host! "admin.lvh.me"
end
test "#index" do
visit my_url
end
end