Commit 7962e3d0

mo k <mo@mokhan.ca>
2012-08-01 02:41:16
add routing spec for comments controller.
1 parent 2073db2
spec/routing/comments_routing_spec.rb
@@ -0,0 +1,15 @@
+require "spec_helper"
+
+describe CommentsController do
+  describe "routing" do
+    it "routes to index" do
+      get('/creations/1/comments').should route_to('comments#index', :creation_id => "1")
+    end
+    it "routes to new" do
+      get('/creations/1/comments/new').should route_to("comments#new", :creation_id => "1")
+    end
+    it "routes to create" do
+      post('/creations/1/comments').should route_to("comments#create", :creation_id => "1")
+    end
+  end
+end
spec/routing/photos_routing_spec.rb
@@ -11,3 +11,15 @@ describe PhotosController do
     end
   end
 end
+describe FavoritesController do
+  describe "routing" do
+    it "should route to create" do
+      get('creations/1/favorites').should 
+        route_to(:controller => "favorites", :action => "index", :creation_id => 1, :method => "GET")
+    end
+    it "should route to delete" do
+      post('creations/1/favorites').should 
+        route_to(:controller => "favorites", :action => "create", :creation_id => 1, :method => "POST")
+    end
+  end
+end