Sha256: 63116ba784d3dd93cb2001607fd95d90afe5e5ffca3e713a7be154a654105d09

Contents?: true

Size: 1.61 KB

Versions: 41

Compression:

Stored size: 1.61 KB

Contents

require "rails_helper"

#The standard rest routes for the group controller
RSpec.describe "<%= module_camel.pluralize %> controller rest routing", :type => :routing do
	routes { <%= module_camel %>::Engine.routes }

	it "routes to index" do
		expect(:get => "/api/<%= api_version %>/<%= resource_plural %>").to route_to(
			:controller => "<%= module_snake %>/api/v<%= api_version %>/<%= resource_plural %>",
			:action => "index"
		)
	end
	it "routes to show" do
		expect(:get => "/api/<%= api_version %>/<%= resource_plural %>/1").to route_to(
			:controller => "<%= module_snake %>/api/v<%= api_version %>/<%= resource_plural %>",
			:action => "show",
			:id => "1"
		)
	end
	it "routes to create" do
		expect(:post => "/api/<%= api_version %>/<%= resource_plural %>/").to route_to(
			:controller => "<%= module_snake %>/api/v<%= api_version %>/<%= resource_plural %>",
			:action => "create"
		)
	end
	it "routes to update" do
		expect(:put => "/api/<%= api_version %>/<%= resource_plural %>/1/").to route_to(
			:controller => "<%= module_snake %>/api/v<%= api_version %>/<%= resource_plural %>",
			:action => "update",
			:id => "1"
		)
	end
	it "routes to update" do
		expect(:patch => "/api/<%= api_version %>/<%= resource_plural %>/1/").to route_to(
			:controller => "<%= module_snake %>/api/v<%= api_version %>/<%= resource_plural %>",
			:action => "update",
			:id => "1"
		)
	end
	it "routes to delete" do
		expect(:delete => "/api/<%= api_version %>/<%= resource_plural %>/1/").to route_to(
			:controller => "<%= module_snake %>/api/v<%= api_version %>/<%= resource_plural %>",
			:action => "destroy",
			:id => "1"
		)
	end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
json_voorhees-1.5.1 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.5.0 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.4.9 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.4.8 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.4.7 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.4.6 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.4.5 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.4.2 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.4.1 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.4.0 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.3.2 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.3.1 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.3.0 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-1.0.0 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-0.5.5 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-0.5.4 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-0.5.3 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-0.5.2 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-0.5.1 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb
json_voorhees-0.5.0 lib/generators/json_voorhees/app_make_tests/templates/routing.rb.erb