rspec-rails 2.14.2 with Rails 4.2 InvalidURIError
Asked Answered
B

1

10

I have gem 'rspec-rails', '~> 2.14.2' in my Gemfile.
After upgrading from Rails 4.1 to Rails 4.2 I've got the following error while running rspec:

Failure/Error: get 'api/...'
URI::InvalidURIError:
  the scheme http does not accept registry part: www.example.com:80api (or bad hostname?)

What's the fix?

Brainbrainard answered 29/11, 2014 at 10:38 Comment(0)
B
16

Adding / to a path fixes the issue.

E.g.:
get 'api/...' => get '/api/...'
post 'api/...' => post '/api/...'
patch 'api/...' => patch '/api/...'
put 'api/...' => put '/api/...'
etc.

EDIT: the reason is explained here.

Brainbrainard answered 29/11, 2014 at 10:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.