Add inflection for API acronym
This commit is contained in:
parent
5719cbcbe9
commit
40f4ced3b8
@ -1,4 +1,4 @@
|
|||||||
class Api::ApplicationController < ApplicationController
|
class API::ApplicationController < ApplicationController
|
||||||
skip_before_filter :verify_authenticity_token
|
skip_before_filter :verify_authenticity_token
|
||||||
skip_before_filter :authenticate!, :only => [:cor_preflight]
|
skip_before_filter :authenticate!, :only => [:cor_preflight]
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
class Api::PlaylistsController < Api::ApplicationController
|
class API::PlaylistsController < API::ApplicationController
|
||||||
respond_to :json
|
respond_to :json
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
class Api::SessionsController < Api::ApplicationController
|
class API::SessionsController < API::ApplicationController
|
||||||
skip_before_filter :authenticate!, :only => [:create]
|
skip_before_filter :authenticate!, :only => [:create]
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
class Api::SoundsController < Api::ApplicationController
|
class API::SoundsController < API::ApplicationController
|
||||||
# FIXME: add some tests!
|
# FIXME: add some tests!
|
||||||
def show
|
def show
|
||||||
sound = Sound.find params[:id]
|
sound = Sound.find params[:id]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
class Api::TracksController < Api::ApplicationController
|
class API::TracksController < API::ApplicationController
|
||||||
def index
|
def index
|
||||||
@tracks = Track.all
|
@tracks = Track.all
|
||||||
end
|
end
|
||||||
|
@ -13,3 +13,7 @@
|
|||||||
# ActiveSupport::Inflector.inflections do |inflect|
|
# ActiveSupport::Inflector.inflections do |inflect|
|
||||||
# inflect.acronym 'RESTful'
|
# inflect.acronym 'RESTful'
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
ActiveSupport::Inflector.inflections do |inflect|
|
||||||
|
inflect.acronym 'API'
|
||||||
|
end
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Api::ApplicationController do
|
describe API::ApplicationController do
|
||||||
include UserControllerHelpers
|
include UserControllerHelpers
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@ -13,7 +13,7 @@ describe Api::ApplicationController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context 'preflight' do
|
context 'preflight' do
|
||||||
controller(Api::ApplicationController) do
|
controller(API::ApplicationController) do
|
||||||
alias_method :index, :cor_preflight
|
alias_method :index, :cor_preflight
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ describe Api::ApplicationController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe 'before filter' do
|
describe 'before filter' do
|
||||||
controller(Api::ApplicationController) do
|
controller(API::ApplicationController) do
|
||||||
def index
|
def index
|
||||||
head :ok
|
head :ok
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Api::PlaylistsController do
|
describe API::PlaylistsController do
|
||||||
include UserControllerHelpers
|
include UserControllerHelpers
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Api::SessionsController do
|
describe API::SessionsController do
|
||||||
describe 'POST create' do
|
describe 'POST create' do
|
||||||
let(:user) { Factory.create(:user) }
|
let(:user) { Factory.create(:user) }
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Api::TracksController do
|
describe API::TracksController do
|
||||||
include UserControllerHelpers
|
include UserControllerHelpers
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe '/api OPTIONS requests routing' do
|
describe '/api OPTIONS requests routing' do
|
||||||
it 'routes to Api::ApplicationController#cor_preflight' do
|
it 'routes to API::ApplicationController#cor_preflight' do
|
||||||
{ :options => '/api/some_route' }.should route_to(
|
{ :options => '/api/some_route' }.should route_to(
|
||||||
:controller => 'api/application',
|
:controller => 'api/application',
|
||||||
:action => 'cor_preflight',
|
:action => 'cor_preflight',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user