rails/rails — pull request #17870 by morgoth (2014-12-01 19:23:10+00:00)
Title: Fixed passing path without leading slash to request helpers in integration tests

In rails 4.1.x it was possible to call `get "some-path"` without leading slash in integration tests.
This is no longer true in 4.1.2.rc1.

```Ruby
# Activate the gem you are reporting the issue against.
# gem 'rails', '4.1.8'
gem "rails", "4.2.0.rc1"

require 'rails'
require 'action_controller/railtie'

class TestApp < Rails::Application
config.root = File.dirname(__FILE__)
config.session_store :cookie_store, key: 'cookie_store_key'
secrets.secret_token = 'secret_token'
secrets.secret_key_base = 'secret_key_base'

config.logger = Logger.new($stdout)
Rails.logger = config.logger

routes.draw do
get '/testing' => 'test#index'
end
end

class TestController < ActionController::Base
include Rails.application.routes.url_helpers

def index
render text: 'Home'
end
end

require 'minitest/autorun'
require 'rack/test'

class BugTest < ActionDispatch::IntegrationTest

def test_returns_success
get 'testing'
assert_equal 200, response.status
end

private
def app
Rails.application
end
end
```

This fails with:

```
1) Error:
BugTest#test_returns_success:
URI::InvalidURIError: the scheme http does not accept registry part: www.example.com:80testing (or bad hostname?)
/home/wojtek/.rbenv/versions/2.1.2/lib/ruby/2.1.0/uri/generic.rb:214:in `initialize'
/home/wojtek/.rbenv/versions/2.1.2/lib/ruby/2.1.0/uri/http.rb:84:in `initialize'
/home/wojtek/.rbenv/versions/2.1.2/lib/ruby/2.1.0/uri/common.rb:214:in `new'
/home/wojtek/.rbenv/versions/2.1.2/lib/ruby/2.1.0/uri/common.rb:214:in `parse'
/home/wojtek/.rbenv/versions/2.1.2/lib/ruby/2.1.0/uri/common.rb:747:in `parse'
/home/wojtek/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rack-test-0.6.2/lib/rack/test.rb:179:in `env_for'
/home/wojtek/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rack-test-0.6.2/lib/rack/test.rb:122:in `request'
/home/wojtek/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/actionpack-4.2.0.rc1/lib/action_dispatch/testing/integration.rb:297:in `process'
/home/wojtek/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/actionpack-4.2.0.rc1/lib/action_dispatch/testing/integration.rb:32:in `get'
/home/wojtek/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/actionpack-4.2.0.rc1/lib/action_dispatch/testing/integration.rb:344:in `block (2 levels) in '
route-test-minitest.rb:36:in `test_returns_success'
```

I'm not sure if I placed test in a proper place, please let me know if something can be improved