diff --git a/app/controllers/comments_controller.rb b/app/controllers/api/comments_controller.rb similarity index 82% rename from app/controllers/comments_controller.rb rename to app/controllers/api/comments_controller.rb index 7fdff2a..ca74e08 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/api/comments_controller.rb @@ -1,7 +1,7 @@ -class CommentsController < ApplicationController +class Api::CommentsController < ApplicationController respond_to :json - before_filter :ensure_authenticated!, :only => [:create, :update, :destroy] + before_filter :ensure_authenticated!, :only => [:create, :destroy] before_filter :load_asciicast, :only => [:index, :create] def index diff --git a/config/routes.rb b/config/routes.rb index fc6b128..0f82e9d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,4 @@ AsciiIo::Application.routes.draw do - resources :comments resources :asciicasts match ':id' => 'asciicasts#show', :constraints => { :id => /\d+/ } diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/api/comments_controller_spec.rb similarity index 98% rename from spec/controllers/comments_controller_spec.rb rename to spec/controllers/api/comments_controller_spec.rb index 3f79b7d..dbeb1d0 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/api/comments_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe CommentsController do +describe Api::CommentsController do let(:user) { Factory(:user) } let(:asciicast) { mock_model(Asciicast) }