planting routing specs to use slug

This commit is contained in:
Brenda Wallace
2019-12-21 09:40:11 +13:00
parent cae9fffea6
commit 3decc69bca

View File

@@ -14,11 +14,11 @@ describe PlantingsController do
end
it "routes to #show" do
get("/plantings/1").should route_to("plantings#show", id: "1")
get("/plantings/tomato").should route_to("plantings#show", slug: "tomato")
end
it "routes to #edit" do
get("/plantings/1/edit").should route_to("plantings#edit", id: "1")
get("/plantings/tomato/edit").should route_to("plantings#edit", slug: "tomato")
end
it "routes to #create" do
@@ -26,11 +26,11 @@ describe PlantingsController do
end
it "routes to #update" do
put("/plantings/1").should route_to("plantings#update", id: "1")
put("/plantings/tomato").should route_to("plantings#update", slug: "tomato")
end
it "routes to #destroy" do
delete("/plantings/1").should route_to("plantings#destroy", id: "1")
delete("/plantings/tomato").should route_to("plantings#destroy", slug: "tomato")
end
end
end