Sha256: 7708b3a8c5a526296203b582c326b87592103b2237c166b4b809fe488d455fd9

Contents?: true

Size: 1.12 KB

Versions: 4

Compression:

Stored size: 1.12 KB

Contents

require "spec_helper"

<% module_namespacing do -%>
describe <%= controller_class_name %>Controller 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 -%>

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
rspec-rails-3.0.0.beta2 lib/generators/rspec/scaffold/templates/routing_spec.rb
simple_token_authentication-1.0.0.pre.5 test/dummy/lib/templates/rspec/scaffold/routing_spec.rb
simple_token_authentication-1.0.0.beta.5 test/dummy/lib/templates/rspec/scaffold/routing_spec.rb
rspec-rails-3.0.0.beta1 lib/generators/rspec/scaffold/templates/routing_spec.rb