diff --git a/app/assets/javascripts/app/models/post/interactions.js b/app/assets/javascripts/app/models/post/interactions.js index c7db08827..5770b3291 100644 --- a/app/assets/javascripts/app/models/post/interactions.js +++ b/app/assets/javascripts/app/models/post/interactions.js @@ -3,10 +3,6 @@ //require ../post app.models.Post.Interactions = Backbone.Model.extend({ - url : function(){ - return this.post.url() + "/interactions"; - }, - initialize : function(options){ this.post = options.post; this.comments = new app.collections.Comments(this.get("comments"), {post : this.post}); diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index aa1aa3e9a..9d6b3258c 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -39,16 +39,6 @@ class PostsController < ApplicationController head :not_found end - def interactions - respond_to do |format| - format.json { - post = post_service.find!(params[:id]) - render json: PostInteractionPresenter.new(post, current_user) - } - format.any { head :not_acceptable } - end - end - def mentionable respond_to do |format| format.json { diff --git a/config/routes.rb b/config/routes.rb index b7d4c69ab..82d9afc91 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -29,7 +29,6 @@ Rails.application.routes.draw do resources :posts, only: %i(show destroy) do member do - get :interactions get :mentionable end diff --git a/spec/controllers/posts_controller_spec.rb b/spec/controllers/posts_controller_spec.rb index 28216a97e..2c5f72f92 100644 --- a/spec/controllers/posts_controller_spec.rb +++ b/spec/controllers/posts_controller_spec.rb @@ -129,38 +129,6 @@ describe PostsController, type: :controller do end end - describe "#interactions" do - context "user not signed in" do - it "returns a 401 for private posts and format json" do - get :interactions, params: {id: post.id}, format: :json - expect(response.status).to eq(401) - expect(JSON.parse(response.body)["error"]).to eq(I18n.t("devise.failure.unauthenticated")) - end - - it "returns a 406 for private posts and format html" do - get :interactions, params: {id: post.id} - expect(response.status).to eq(406) - end - end - - context "user signed in" do - before do - sign_in alice - end - - it "shows interactions of a post as json" do - get :interactions, params: {id: post.id}, format: :json - expect(response.body).to eq(PostInteractionPresenter.new(post, alice).to_json) - end - - it "returns a 406 for format html" do - sign_in alice - get :interactions, params: {id: post.id} - expect(response.status).to eq(406) - end - end - end - describe "#mentionable" do context "with a user signed in" do before do