require "rails_helper" <% if options.arcadex? %> #The register, login, and logout routes RSpec.describe "Users sign up process routing", :type => :routing do routes { People::Engine.routes } it "routes to register" do expect(:post => "/api/1/users/register").to route_to( :controller => "people/api/v1/users", :action => "register" ) end it "routes to login" do expect(:post => "/api/1/users/login").to route_to( :controller => "people/api/v1/users", :action => "login" ) end it "routes to logout" do expect(:post => "/api/1/users/logout").to route_to( :controller => "people/api/v1/users", :action => "logout" ) end it "routes to authenticate" do expect(:post => "/api/1/users/authenticate/1").to route_to( :controller => "people/api/v1/users", :action => "authenticate", :id => "1" ) end end <% end %> #The standard rest routes for the user controller RSpec.describe "Users controller rest routing", :type => :routing do routes { People::Engine.routes } it "routes to index" do expect(:get => "/api/1/users").to route_to( :controller => "people/api/v1/users", :action => "index" ) end it "routes to show" do expect(:get => "/api/1/users/1").to route_to( :controller => "people/api/v1/users", :action => "show", :id => "1" ) end it "routes to edit" do expect(:get => "/api/1/users/1/edit").to route_to( :controller => "people/api/v1/users", :action => "edit", :id => "1" ) end it "routes to create" do expect(:post => "/api/1/users/").to route_to( :controller => "people/api/v1/users", :action => "create" ) end it "routes to update" do expect(:put => "/api/1/users/1/").to route_to( :controller => "people/api/v1/users", :action => "update", :id => "1" ) end it "routes to update" do expect(:patch => "/api/1/users/1/").to route_to( :controller => "people/api/v1/users", :action => "update", :id => "1" ) end it "routes to delete" do expect(:delete => "/api/1/users/1/").to route_to( :controller => "people/api/v1/users", :action => "destroy", :id => "1" ) end end