Skip to content

Commit

Permalink
Update pages_controller_spec.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
leesheppard committed Nov 2, 2024
1 parent 059c98d commit 52f203a
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions spec/controllers/pages_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,24 @@
describe "on GET to /committee-members" do
before { get :show, params: { id: "committee-members" } }

it "responds with success and render template" do
it "responds with success" do
expect(response).to be_successful
expect(response).to render_template("committee-members")
end
end

describe "on GET to /committee-members" do
before { get :show, params: { id: "committee-members" } }

it "responds with success and render template" do
expect(response).to be_successful
it "renders the correct template" do
expect(response).to render_template("committee-members")
end
end

it "raises a routing error for an invalid page" do
expect { get :show, params: { id: "invalid" } }
.to raise_error(ActionController::RoutingError)
end

it "raises a routing error for a page in another directory" do
expect { get :show, params: { id: "other/wrong" } }
.to raise_error(ActionController::RoutingError)
end

it "raises a routing error for an invalid page" do
expect { get :show, params: { id: "invalid" } }
.to raise_error(ActionController::RoutingError)
end
context "when accessing invalid pages" do
it "raises a routing error for an invalid page" do
expect { get :show, params: { id: "invalid" } }
.to raise_error(ActionController::RoutingError)
end

it "raises a routing error for a page in another directory" do
expect { get :show, params: { id: "other/wrong" } }
.to raise_error(ActionController::RoutingError)
it "raises a routing error for a page in another directory" do
expect { get :show, params: { id: "other/wrong" } }
.to raise_error(ActionController::RoutingError)
end
end
end

0 comments on commit 52f203a

Please sign in to comment.