Sha256: 2ce809787a2ae42f0581b1f9e2229978aff05083a5269d41b370ee16d071b5d8

Contents?: true

Size: 1.89 KB

Versions: 4

Compression:

Stored size: 1.89 KB

Contents

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
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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
json_voorhees-0.4.8 lib/generators/json_voorhees/app_make_user/templates/user/specs/route_specs.rb
json_voorhees-0.4.7 lib/generators/json_voorhees/app_make_user/templates/user/specs/route_specs.rb
json_voorhees-0.4.6 lib/generators/json_voorhees/app_make_user/templates/user/specs/route_specs.rb
json_voorhees-0.4.5 lib/generators/json_voorhees/app_make_user/templates/user/specs/route_specs.rb