Commit f42033f2

mo khan <mo@mokhan.ca>
2014-07-08 04:41:08
fix broken routing specs.
1 parent 99cff55
spec/routing/categories_routing_spec.rb
@@ -3,8 +3,7 @@ require "rails_helper"
 describe CategoriesController do
   describe "routing" do
     it "routes to #show" do
-      get("/categories/fondant").should route_to({:slug => "fondant", :controller => "categories", :action => "show"})
-      get("/categories/fondant/page/1").should route_to({:slug => "fondant", :controller => "categories", :action => "show", :page => "1"})
+      expect(get: "/categories/fondant").to route_to(slug: "fondant", controller: "categories", action: "show")
     end
   end
 end
spec/routing/creations_routing_spec.rb
@@ -3,7 +3,7 @@ require "rails_helper"
 describe CreationsController do
   describe "routing" do
     it "is the root of the website" do
-      get('/').should route_to("creations#index")
+      { get: '/' }.should route_to("creations#index")
     end
 
     it "recognizes and generates #index" do
spec/routing/favorites_routing_spec.rb
@@ -4,7 +4,7 @@ describe FavoritesController do
   describe "routing" do
 
     it "routes to #index" do
-      get("/creations/1/favorites").should route_to({
+      { get: "/creations/1/favorites" }.should route_to({
         :controller => "favorites",
         :action => "index",
         :creation_id => "1"
@@ -12,7 +12,7 @@ describe FavoritesController do
     end
 
     it "routes to #create" do
-      post("/creations/1/favorites").should route_to({
+      { post: "/creations/1/favorites" }.should route_to({
         :controller => "favorites",
         :action => "create",
         :creation_id => "1"
spec/routing/home_routing_spec.rb
@@ -3,10 +3,11 @@ require 'rails_helper'
 describe HomeController do
   describe "routing" do
     it "routes to about us" do
-      get('about_us').should route_to("home#about_us")
+      expect(get: 'about_us').to route_to("home#about_us")
     end
+
     it "routes to why" do
-      get('why_cakeside').should route_to("home#why_cakeside")
+      expect(get: 'why_cakeside').to route_to("home#why_cakeside")
     end
   end
 end
spec/routing/photos_routing_spec.rb
@@ -1,13 +0,0 @@
-require "rails_helper"
-describe PhotosController do
-  describe "routing" do
-    it "should route to create" do
-      post('creations/1/photos').should 
-        route_to(:controller => "photos", :action => "create", :creation_id => 1, :method => "POST")
-    end
-    it "should route to delete" do
-      delete('creations/1/photos').should 
-        route_to(:controller => "photos", :action => "destroy", :creation_id => 1, :method => "DELETE")
-    end
-  end
-end
spec/routing/profiles_routing_spec.rb
@@ -3,11 +3,11 @@ require 'rails_helper'
 describe ProfilesController do
   describe "routing" do
     it "routes to index" do
-      get('/profiles/').should route_to("profiles#index")
+      expect(get: '/profiles/').to route_to("profiles#index")
     end
 
     it "routes to #show" do
-      get("/profiles/1").should route_to("profiles#show", :id => "1")
+      expect(get: "/profiles/1").to route_to("profiles#show", id: "1")
     end
   end
 end
spec/routing/tutorials_routing_spec.rb
@@ -2,34 +2,32 @@ require "rails_helper"
 
 describe TutorialsController do
   describe "routing" do
-
     it "routes to #index" do
-      get("/tutorials").should route_to("tutorials#index")
+      expect(get: "/tutorials").to route_to("tutorials#index")
     end
 
     it "routes to #new" do
-      get("/tutorials/new").should route_to("tutorials#new")
+      expect(get: "/tutorials/new").to route_to("tutorials#new")
     end
 
     it "routes to #show" do
-      get("/tutorials/1").should route_to("tutorials#show", :id => "1")
+      expect(get: "/tutorials/1").to route_to("tutorials#show", :id => "1")
     end
 
     it "routes to #edit" do
-      get("/tutorials/1/edit").should route_to("tutorials#edit", :id => "1")
+      expect(get: "/tutorials/1/edit").to route_to("tutorials#edit", :id => "1")
     end
 
     it "routes to #create" do
-      post("/tutorials").should route_to("tutorials#create")
+      expect(post: "/tutorials").to route_to("tutorials#create")
     end
 
     it "routes to #update" do
-      put("/tutorials/1").should route_to("tutorials#update", :id => "1")
+      expect(put: "/tutorials/1").to route_to("tutorials#update", :id => "1")
     end
 
     it "routes to #destroy" do
-      delete("/tutorials/1").should route_to("tutorials#destroy", :id => "1")
+      expect(delete: "/tutorials/1").to route_to("tutorials#destroy", :id => "1")
     end
-
   end
 end