Commit 953ac793

mo khan <mo@mokhan.ca>
2014-01-19 04:43:12
add route to comments controller
1 parent 12a3ca7
Changed files (3)
app/controllers/comments_controller.rb
@@ -0,0 +1,3 @@
+class CommentsController < ApplicationController
+
+end
config/routes.rb
@@ -4,6 +4,7 @@ Cake::Application.routes.draw do
   get "why_cakeside" => "home#why_cakeside"
 
   get 'dashboard', to: 'dashboard#index'
+  post 'comments', to: 'comments#create'
 
   resources :tutorials do
     get 'page/:page', :action => :index, :on => :collection
spec/routing/comments_routing_spec.rb
@@ -0,0 +1,8 @@
+require "spec_helper"
+
+
+describe "/comments" do
+  it "routes to the create action" do
+    expect({ :post => '/comments' }).to route_to(controller: 'comments', action: 'create')
+  end
+end