master
1require "rails_helper"
2
3describe "/cakes" do
4 it "is the root of the website" do
5 expect(get: '/').to route_to("cakes#index")
6 end
7
8 it "recognizes and generates #index" do
9 expect(get: 'cakes').to route_to(controller: 'cakes', action: 'index')
10 end
11
12 it "recognizes and generates #show" do
13 expect(get: "/cakes/1").to route_to(controller: "cakes", action: "show", id: "1")
14 end
15
16 it "routes to the newest cakes" do
17 expect(get: '/cakes/newest').to route_to(controller: "cakes", action: "index", sort: 'newest')
18 end
19
20 it "routes to the oldest cakes" do
21 expect(get: '/cakes/oldest').to route_to(controller: "cakes", action: "index", sort: 'oldest')
22 end
23end