Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
source "https://rubygems.org"

ruby "3.4.1"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 8.0.1"
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -474,5 +474,8 @@ DEPENDENCIES
tzinfo-data
web-console

RUBY VERSION
ruby 3.4.1p0

BUNDLED WITH
2.6.2
37 changes: 37 additions & 0 deletions spec/routing/topics_routing_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
require "rails_helper"

RSpec.describe TopicsController, type: :routing do
describe "routing" do
it "routes to #index" do
expect(get: "/topics").to route_to("topics#index")
end

it "routes to #new" do
expect(get: "/topics/new").to route_to("topics#new")
end

it "routes to #show" do
expect(get: "/topics/1").to route_to("topics#show", id: "1")
end

it "routes to #edit" do
expect(get: "/topics/1/edit").to route_to("topics#edit", id: "1")
end

it "routes to #create" do
expect(post: "/topics").to route_to("topics#create")
end

it "routes to #update via PUT" do
expect(put: "/topics/1").to route_to("topics#update", id: "1")
end

it "routes to #update via PATCH" do
expect(patch: "/topics/1").to route_to("topics#update", id: "1")
end

it "routes to #destroy" do
expect(delete: "/topics/1").to route_to("topics#destroy", id: "1")
end
end
end