...
constraints subdomain: 'api' do scope module: 'api' do
# API v1 namespace :v1 do resources :users, except: :edit
end
end
end
module Api::V1 class UsersController < ApplicationController
def my_methods
...
end
end
end
require "rails_helper"
RSpec.describe Api::V1::UsersController, type: :routing do
describe "routing" do
it "routes to #index" do expect(:get => "/users").to route_to("api/v1/users#index") end
end
end
Api::V1::UsersController routing routes to #index Failure/Error: expect(:get => "/users").to route_to("users#index") No route matches "/users"
# ./spec/routing/users_routing_spec.rb:8:in `block (3 levels) in <top (required)>'
--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/823c800d-15c8-40a1-a143-5e77a8e27d29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
expect(:get => "/v1/users").to route_to("api/v1/users#index")
Api::V1::UsersController routing routes to #index
Failure/Error: expect(:get => "/users", :subdomain => 'api').to route_to("api/v1/users#index") No route matches "/users"
Api::V1::UsersController routing routes to #index
Failure/Error: expect(:get => "/v1/users", :subdomain => 'api').to route_to("api/v1/users#index") No route matches "/v1/users"
# ./spec/routing/users_routing_spec.rb:8:in `block (3 levels) in <top (required)>'
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/c8b1ade5-fab2-4abf-b806-3eba3e863057%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/59ea7e35-7ea0-44c4-88c1-e6531bf1fcf4%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/8958f036-2e9a-4f1a-87dc-14784647d603%40googlegroups.com.