Rename `CommentController` to `CommentsController`
This commit is contained in:
parent
d36fbf85f4
commit
5afaef427c
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CommentController < ApplicationController
|
||||
class CommentsController < ApplicationController
|
||||
def index
|
||||
answer = Answer.find(params[:id])
|
||||
@comments = Comment.where(answer:).includes([{ user: :profile }, :smiles])
|
|
@ -154,10 +154,10 @@ Rails.application.routes.draw do
|
|||
get "/@:username/a/:id", to: "answer#show", as: :answer
|
||||
post "/@:username/a/:id/pin", to: "answer#pin", as: :pin_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/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/followings", to: "user#followings", as: :show_user_followings
|
||||
get "/@:username/friends", to: redirect("/@%{username}/followings")
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require "rails_helper"
|
||||
|
||||
describe CommentController, type: :controller do
|
||||
describe CommentsController, type: :controller do
|
||||
describe "#index" do
|
||||
shared_examples_for "succeeds" do
|
||||
it "returns the correct response" do
|
Loading…
Reference in New Issue