diff --git a/app/controllers/reaction_controller.rb b/app/controllers/reactions_controller.rb similarity index 77% rename from app/controllers/reaction_controller.rb rename to app/controllers/reactions_controller.rb index c6df6000..fbf01fce 100644 --- a/app/controllers/reaction_controller.rb +++ b/app/controllers/reactions_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class ReactionController < ApplicationController +class ReactionsController < ApplicationController def index answer = Answer.includes([smiles: { user: :profile }]).find(params[:id]) diff --git a/app/views/reaction/index.html.haml b/app/views/reactions/index.html.haml similarity index 100% rename from app/views/reaction/index.html.haml rename to app/views/reactions/index.html.haml diff --git a/config/routes.rb b/config/routes.rb index 57e9e243..fabc4263 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -155,7 +155,7 @@ Rails.application.routes.draw do 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: "comments#index", as: :comments - get "/@:username/a/:id/reactions", to: "reaction#index", as: :reactions + get "/@:username/a/:id/reactions", to: "reactions#index", as: :reactions get "/@:username/q/:id", to: "question#show", as: :question get "/@:username/c/:id/reactions", to: "comments/reactions#index", as: :comment_reactions get "/@:username/followers", to: "user#followers", as: :show_user_followers diff --git a/spec/controllers/reaction_controller_spec.rb b/spec/controllers/reactions_controller_spec.rb similarity index 87% rename from spec/controllers/reaction_controller_spec.rb rename to spec/controllers/reactions_controller_spec.rb index 1b76617f..e5e7ede5 100644 --- a/spec/controllers/reaction_controller_spec.rb +++ b/spec/controllers/reactions_controller_spec.rb @@ -2,12 +2,12 @@ require "rails_helper" -describe ReactionController, type: :controller do +describe ReactionsController, type: :controller do describe "#index" do shared_examples_for "succeeds" do it "returns the correct response" do subject - expect(response).to have_rendered("reaction/index") + expect(response).to have_rendered :index expect(response).to have_http_status(200) end end