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