-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
routing_spec.rb
39 lines (30 loc) · 1.14 KB
/
routing_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require "rails_helper"
<% module_namespacing do -%>
RSpec.describe <%= controller_class_name %>Controller, :type => :routing do
describe "routing" do
<% unless options[:singleton] -%>
it "routes to #index" do
expect(:get => "/<%= ns_table_name %>").to route_to("<%= ns_table_name %>#index")
end
<% end -%>
it "routes to #new" do
expect(:get => "/<%= ns_table_name %>/new").to route_to("<%= ns_table_name %>#new")
end
it "routes to #show" do
expect(:get => "/<%= ns_table_name %>/1").to route_to("<%= ns_table_name %>#show", :id => "1")
end
it "routes to #edit" do
expect(:get => "/<%= ns_table_name %>/1/edit").to route_to("<%= ns_table_name %>#edit", :id => "1")
end
it "routes to #create" do
expect(:post => "/<%= ns_table_name %>").to route_to("<%= ns_table_name %>#create")
end
it "routes to #update" do
expect(:put => "/<%= ns_table_name %>/1").to route_to("<%= ns_table_name %>#update", :id => "1")
end
it "routes to #destroy" do
expect(:delete => "/<%= ns_table_name %>/1").to route_to("<%= ns_table_name %>#destroy", :id => "1")
end
end
end
<% end -%>