Sha256: 7db5a607344a55ff08ad6082679fcaf33efcce407ecf84891cca320674e4b3c6

Contents?: true

Size: 1.89 KB

Versions: 6

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(:get => "/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

6 entries across 6 versions & 1 rubygems

Version Path
json_voorhees-0.4.4 lib/generators/json_voorhees/app_make_user/templates/user/specs/route_specs.rb
json_voorhees-0.4.3 lib/generators/json_voorhees/app_make_user/templates/user/specs/route_specs.rb
json_voorhees-0.4.2 lib/generators/json_voorhees/app_make_user/templates/user/specs/route_specs.rb
json_voorhees-0.4.1 lib/generators/json_voorhees/app_make_user/templates/user/specs/route_specs.rb
json_voorhees-0.4.0 lib/generators/json_voorhees/app_make_user/templates/user/specs/route_specs.rb
json_voorhees-0.3.9 lib/generators/json_voorhees/app_make_user/templates/user/specs/route_specs.rb