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