Sha256: 00944e02136165382b1711a9251a6a06c09b17d7777f407ad8091d170e53488b

Contents?: true

Size: 1.35 KB

Versions: 42

Compression:

Stored size: 1.35 KB

Contents

require "rails_helper"

<% module_namespacing do -%>
RSpec.describe <%= controller_class_name %>Controller, <%= type_metatag(: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 -%>
<% unless options[:api] -%>
    it "routes to #new" do
      expect(get: "/<%= ns_table_name %>/new").to route_to("<%= ns_table_name %>#new")
    end

<% end -%>
    it "routes to #show" do
      expect(get: "/<%= ns_table_name %>/1").to route_to("<%= ns_table_name %>#show", id: "1")
    end

<% unless options[:api] -%>
    it "routes to #edit" do
      expect(get: "/<%= ns_table_name %>/1/edit").to route_to("<%= ns_table_name %>#edit", id: "1")
    end

<% end -%>

    it "routes to #create" do
      expect(post: "/<%= ns_table_name %>").to route_to("<%= ns_table_name %>#create")
    end

    it "routes to #update via PUT" do
      expect(put: "/<%= ns_table_name %>/1").to route_to("<%= ns_table_name %>#update", id: "1")
    end

    it "routes to #update via PATCH" do
      expect(patch: "/<%= 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 -%>

Version data entries

42 entries across 39 versions & 7 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/rspec-rails-7.1.0/lib/generators/rspec/scaffold/templates/routing_spec.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/rspec-rails-7.1.0/lib/generators/rspec/scaffold/templates/routing_spec.rb
rspec-rails-7.1.0 lib/generators/rspec/scaffold/templates/routing_spec.rb
rspec-rails-7.0.2 lib/generators/rspec/scaffold/templates/routing_spec.rb
rspec-rails-7.0.1 lib/generators/rspec/scaffold/templates/routing_spec.rb
rspec-rails-7.0.0 lib/generators/rspec/scaffold/templates/routing_spec.rb
rspec-rails-6.1.5 lib/generators/rspec/scaffold/templates/routing_spec.rb
rspec-rails-6.1.4 lib/generators/rspec/scaffold/templates/routing_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/rspec-rails-6.1.3/lib/generators/rspec/scaffold/templates/routing_spec.rb
rspec-rails-6.1.3 lib/generators/rspec/scaffold/templates/routing_spec.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/rspec-rails-6.0.4/lib/generators/rspec/scaffold/templates/routing_spec.rb
rspec-rails-6.1.2 lib/generators/rspec/scaffold/templates/routing_spec.rb
rspec-rails-6.1.1 lib/generators/rspec/scaffold/templates/routing_spec.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rspec-rails-5.1.1/lib/generators/rspec/scaffold/templates/routing_spec.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rspec-rails-5.1.2/lib/generators/rspec/scaffold/templates/routing_spec.rb
rspec-rails-6.1.0 lib/generators/rspec/scaffold/templates/routing_spec.rb
rspec-rails-6.0.4 lib/generators/rspec/scaffold/templates/routing_spec.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rspec-rails-5.1.1/lib/generators/rspec/scaffold/templates/routing_spec.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rspec-rails-5.1.2/lib/generators/rspec/scaffold/templates/routing_spec.rb
rspec-rails-6.0.3 lib/generators/rspec/scaffold/templates/routing_spec.rb