0
하위 도메인과 함께 RSpec에 대한 경로를 제공 할 수 없습니다. 테스트 경로는 api.example.com/public/v1/regions/origin?title=indm
RSpec 테스트가 하위 도메인 경로와 함께 실패합니다.
이어야합니다. 그러나 RSpec에 대한 경로를 제공하는 방법을 모르겠습니다. 하위 도메인 api
을이 상대 경로로 경로 지정하는 방법?
let(:api_path) { 'public/v1/regions/origin?title=indm' }
로그
1) Regions Public API GET /v1/regions/origin?title=? returns 200 status code
Failure/Error: get api_path
ActionController::RoutingError:
No route matches [GET] "/public/v1/regions/origin"
# ./spec/api/public/v1/regions_spec.rb:14:in `block (3 levels) in <top (required)>'
이
namespace :api, path: '', constraints: {subdomain: 'api'} do
namespace :public, defaults: { format: :json } do
namespace :v1 do
resources :regions do
get :origin, on: :collection
get :destination, on: :collection
end
end
end
end