forked from expertiza/reimplementation-back-end
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
kmalick
committed
Oct 31, 2024
1 parent
5f2dd73
commit 484d0cf
Showing
4 changed files
with
31 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe CoursesController, type: :routing do | ||
RSpec.describe Api::V1::CoursesController, type: :routing do | ||
describe "routing" do | ||
it "routes to #index" do | ||
expect(get: "/courses").to route_to("courses#index") | ||
expect(get: "/api/v1/courses").to route_to("api/v1/courses#index") | ||
end | ||
|
||
it "routes to #show" do | ||
expect(get: "/courses/1").to route_to("courses#show", id: "1") | ||
expect(get: "/api/v1/courses/1").to route_to("api/v1/courses#show", id: "1") | ||
end | ||
|
||
|
||
it "routes to #create" do | ||
expect(post: "/courses").to route_to("courses#create") | ||
expect(post: "/api/v1/courses").to route_to("api/v1/courses#create") | ||
end | ||
|
||
it "routes to #update via PUT" do | ||
expect(put: "/courses/1").to route_to("courses#update", id: "1") | ||
expect(put: "/api/v1/courses/1").to route_to("api/v1/courses#update", id: "1") | ||
end | ||
|
||
it "routes to #update via PATCH" do | ||
expect(patch: "/courses/1").to route_to("courses#update", id: "1") | ||
expect(patch: "/api/v1/courses/1").to route_to("api/v1/courses#update", id: "1") | ||
end | ||
|
||
it "routes to #destroy" do | ||
expect(delete: "/courses/1").to route_to("courses#destroy", id: "1") | ||
expect(delete: "/api/v1/courses/1").to route_to("api/v1/courses#destroy", id: "1") | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,29 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe JoinTeamRequestsController, type: :routing do | ||
RSpec.describe Api::V1::JoinTeamRequestsController, type: :routing do | ||
describe "routing" do | ||
# Routes to the #index action | ||
it "routes to #index" do | ||
expect(get: "/join_team_requests").to route_to("join_team_requests#index") | ||
expect(get: "/api/v1/join_team_requests").to route_to("api/v1/join_team_requests#index") | ||
end | ||
|
||
# Routes to the #show action with a specific ID | ||
it "routes to #show" do | ||
expect(get: "/join_team_requests/1").to route_to("join_team_requests#show", id: "1") | ||
expect(get: "/api/v1/join_team_requests/1").to route_to("api/v1/join_team_requests#show", id: "1") | ||
end | ||
|
||
# Routes to the #create action | ||
it "routes to #create" do | ||
expect(post: "/join_team_requests").to route_to("join_team_requests#create") | ||
expect(post: "/api/v1/join_team_requests").to route_to("api/v1/join_team_requests#create") | ||
end | ||
|
||
# Routes to the #update action via PUT | ||
it "routes to #update via PUT" do | ||
expect(put: "/join_team_requests/1").to route_to("join_team_requests#update", id: "1") | ||
expect(put: "/api/v1/join_team_requests/1").to route_to("api/v1/join_team_requests#update", id: "1") | ||
end | ||
|
||
# Routes to the #update action via PATCH | ||
it "routes to #update via PATCH" do | ||
expect(patch: "/join_team_requests/1").to route_to("join_team_requests#update", id: "1") | ||
expect(patch: "/api/v1/join_team_requests/1").to route_to("api/v1/join_team_requests#update", id: "1") | ||
end | ||
|
||
# Routes to the #destroy action | ||
it "routes to #destroy" do | ||
expect(delete: "/join_team_requests/1").to route_to("join_team_requests#destroy", id: "1") | ||
expect(delete: "/api/v1/join_team_requests/1").to route_to("api/v1/join_team_requests#destroy", id: "1") | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe SignUpTopicsController, type: :routing do | ||
RSpec.describe Api::V1::SignUpTopicsController, type: :routing do | ||
describe "routing" do | ||
it "routes to #index" do | ||
expect(get: "/sign_up_topics").to route_to("sign_up_topics#index") | ||
expect(get: "/api/v1/sign_up_topics").to route_to("api/v1/sign_up_topics#index") | ||
end | ||
|
||
it "routes to #show" do | ||
expect(get: "/sign_up_topics/1").to route_to("sign_up_topics#show", id: "1") | ||
expect(get: "/api/v1/sign_up_topics/1").to route_to("api/v1/sign_up_topics#show", id: "1") | ||
end | ||
|
||
|
||
it "routes to #create" do | ||
expect(post: "/sign_up_topics").to route_to("sign_up_topics#create") | ||
expect(post: "/api/v1/sign_up_topics").to route_to("api/v1/sign_up_topics#create") | ||
end | ||
|
||
it "routes to #update via PUT" do | ||
expect(put: "/sign_up_topics/1").to route_to("sign_up_topics#update", id: "1") | ||
expect(put: "/api/v1/sign_up_topics/1").to route_to("api/v1/sign_up_topics#update", id: "1") | ||
end | ||
|
||
it "routes to #update via PATCH" do | ||
expect(patch: "/sign_up_topics/1").to route_to("sign_up_topics#update", id: "1") | ||
expect(patch: "/api/v1/sign_up_topics/1").to route_to("api/v1/sign_up_topics#update", id: "1") | ||
end | ||
|
||
it "routes to #destroy" do | ||
expect(delete: "/sign_up_topics/1").to route_to("sign_up_topics#destroy", id: "1") | ||
expect(delete: "/api/v1/sign_up_topics/1").to route_to("api/v1/sign_up_topics#destroy", id: "1") | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe StudentTasksController, type: :routing do | ||
RSpec.describe Api::V1::StudentTasksController, type: :routing do | ||
describe "routing" do | ||
it "routes to #index" do | ||
expect(get: "/student_tasks").to route_to("student_tasks#index") | ||
expect(get: "/api/v1/student_tasks").to route_to("api/v1/student_tasks#index") | ||
end | ||
|
||
it "routes to #show" do | ||
expect(get: "/student_tasks/1").to route_to("student_tasks#show", id: "1") | ||
expect(get: "/api/v1/student_tasks/1").to route_to("api/v1/student_tasks#show", id: "1") | ||
end | ||
|
||
|
||
it "routes to #create" do | ||
expect(post: "/student_tasks").to route_to("student_tasks#create") | ||
expect(post: "/api/v1/student_tasks").to route_to("api/v1/student_tasks#create") | ||
end | ||
|
||
it "routes to #update via PUT" do | ||
expect(put: "/student_tasks/1").to route_to("student_tasks#update", id: "1") | ||
expect(put: "/api/v1/student_tasks/1").to route_to("api/v1/student_tasks#update", id: "1") | ||
end | ||
|
||
it "routes to #update via PATCH" do | ||
expect(patch: "/student_tasks/1").to route_to("student_tasks#update", id: "1") | ||
expect(patch: "/api/v1/student_tasks/1").to route_to("api/v1/student_tasks#update", id: "1") | ||
end | ||
|
||
it "routes to #destroy" do | ||
expect(delete: "/student_tasks/1").to route_to("student_tasks#destroy", id: "1") | ||
expect(delete: "/api/v1/student_tasks/1").to route_to("api/v1/student_tasks#destroy", id: "1") | ||
end | ||
end | ||
end |