Rename `CommentController` to `CommentsController`

This commit is contained in:
Andreas Nedbal 2023-10-29 21:24:52 +01:00
parent d36fbf85f4
commit 5afaef427c
5 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
class CommentController < ApplicationController class CommentsController < ApplicationController
def index def index
answer = Answer.find(params[:id]) answer = Answer.find(params[:id])
@comments = Comment.where(answer:).includes([{ user: :profile }, :smiles]) @comments = Comment.where(answer:).includes([{ user: :profile }, :smiles])

View File

@ -154,10 +154,10 @@ Rails.application.routes.draw do
get "/@:username/a/:id", to: "answer#show", as: :answer get "/@:username/a/:id", to: "answer#show", as: :answer
post "/@:username/a/:id/pin", to: "answer#pin", as: :pin_answer post "/@:username/a/:id/pin", to: "answer#pin", as: :pin_answer
delete "/@:username/a/:id/pin", to: "answer#unpin", as: :unpin_answer delete "/@:username/a/:id/pin", to: "answer#unpin", as: :unpin_answer
get "/@:username/a/:id/comments", to: "comment#index", as: :comments get "/@:username/a/:id/comments", to: "comments#index", as: :comments
get "/@:username/a/:id/reactions", to: "reaction#index", as: :reactions get "/@:username/a/:id/reactions", to: "reaction#index", as: :reactions
get "/@:username/q/:id", to: "question#show", as: :question get "/@:username/q/:id", to: "question#show", as: :question
get "/@:username/c/:id/reactions", to: "comment#show_reactions", as: :comment_reactions get "/@:username/c/:id/reactions", to: "comments#show_reactions", as: :comment_reactions
get "/@:username/followers", to: "user#followers", as: :show_user_followers get "/@:username/followers", to: "user#followers", as: :show_user_followers
get "/@:username/followings", to: "user#followings", as: :show_user_followings get "/@:username/followings", to: "user#followings", as: :show_user_followings
get "/@:username/friends", to: redirect("/@%{username}/followings") get "/@:username/friends", to: redirect("/@%{username}/followings")

View File

@ -2,7 +2,7 @@
require "rails_helper" require "rails_helper"
describe CommentController, type: :controller do describe CommentsController, type: :controller do
describe "#index" do describe "#index" do
shared_examples_for "succeeds" do shared_examples_for "succeeds" do
it "returns the correct response" do it "returns the correct response" do