Fix #52 - Add API versioning (v1)
parent
3f75f52285
commit
4f9b7432dd
@ -1,4 +1,4 @@ |
||||
class Api::AccountsController < ApiController |
||||
class Api::V1::AccountsController < ApiController |
||||
before_action :doorkeeper_authorize! |
||||
before_action :set_account |
||||
respond_to :json |
@ -1,4 +1,4 @@ |
||||
class Api::AppsController < ApplicationController |
||||
class Api::V1::AppsController < ApplicationController |
||||
respond_to :json |
||||
|
||||
def create |
@ -1,4 +1,4 @@ |
||||
class Api::FollowsController < ApiController |
||||
class Api::V1::FollowsController < ApiController |
||||
before_action :doorkeeper_authorize! |
||||
respond_to :json |
||||
|
@ -1,4 +1,4 @@ |
||||
class Api::MediaController < ApiController |
||||
class Api::V1::MediaController < ApiController |
||||
before_action :doorkeeper_authorize! |
||||
respond_to :json |
||||
|
@ -1,4 +1,4 @@ |
||||
class Api::StatusesController < ApiController |
||||
class Api::V1::StatusesController < ApiController |
||||
before_action :doorkeeper_authorize! |
||||
respond_to :json |
||||
|
@ -1,2 +0,0 @@ |
||||
module Api::AccountsHelper |
||||
end |
@ -1,2 +0,0 @@ |
||||
module Api::AppsHelper |
||||
end |
@ -1,2 +0,0 @@ |
||||
module Api::FollowsHelper |
||||
end |
@ -1,2 +0,0 @@ |
||||
module Api::MediaHelper |
||||
end |
@ -1,2 +0,0 @@ |
||||
module Api::SalmonHelper |
||||
end |
@ -1,2 +0,0 @@ |
||||
module Api::StatusesHelper |
||||
end |
@ -1,2 +0,0 @@ |
||||
module Api::SubscriptionsHelper |
||||
end |
@ -1,2 +0,0 @@ |
||||
collection @followers |
||||
extends('api/accounts/show') |
@ -1,2 +0,0 @@ |
||||
collection @following |
||||
extends('api/accounts/show') |
@ -1,2 +0,0 @@ |
||||
collection @accounts |
||||
extends 'api/accounts/relationship' |
@ -1,2 +0,0 @@ |
||||
collection @statuses |
||||
extends('api/statuses/show') |
@ -1,2 +0,0 @@ |
||||
object @account |
||||
extends('api/accounts/show') |
@ -1,2 +0,0 @@ |
||||
collection @statuses |
||||
extends('api/statuses/show') |
@ -1,2 +0,0 @@ |
||||
collection @statuses |
||||
extends('api/statuses/show') |
@ -0,0 +1,2 @@ |
||||
collection @followers |
||||
extends('api/v1/accounts/show') |
@ -0,0 +1,2 @@ |
||||
collection @following |
||||
extends('api/v1/accounts/show') |
@ -0,0 +1,2 @@ |
||||
collection @accounts |
||||
extends 'api/v1/accounts/relationship' |
@ -0,0 +1,2 @@ |
||||
collection @statuses |
||||
extends('api/v1/statuses/show') |
@ -0,0 +1,2 @@ |
||||
object @account |
||||
extends('api/v1/accounts/show') |
@ -0,0 +1,2 @@ |
||||
collection @statuses |
||||
extends('api/v1/statuses/show') |
@ -0,0 +1,2 @@ |
||||
collection @statuses |
||||
extends('api/v1/statuses/show') |
@ -1,6 +1,6 @@ |
||||
require 'rails_helper' |
||||
|
||||
RSpec.describe Api::AccountsController, type: :controller do |
||||
RSpec.describe Api::V1::AccountsController, type: :controller do |
||||
render_views |
||||
|
||||
let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } |
@ -1,6 +1,6 @@ |
||||
require 'rails_helper' |
||||
|
||||
RSpec.describe Api::AppsController, type: :controller do |
||||
RSpec.describe Api::V1::AppsController, type: :controller do |
||||
render_views |
||||
|
||||
describe 'POST #create' do |
@ -1,6 +1,6 @@ |
||||
require 'rails_helper' |
||||
|
||||
RSpec.describe Api::FollowsController, type: :controller do |
||||
RSpec.describe Api::V1::FollowsController, type: :controller do |
||||
render_views |
||||
|
||||
let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } |
@ -1,6 +1,6 @@ |
||||
require 'rails_helper' |
||||
|
||||
RSpec.describe Api::MediaController, type: :controller do |
||||
RSpec.describe Api::V1::MediaController, type: :controller do |
||||
render_views |
||||
|
||||
let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } |
@ -1,6 +1,6 @@ |
||||
require 'rails_helper' |
||||
|
||||
RSpec.describe Api::StatusesController, type: :controller do |
||||
RSpec.describe Api::V1::StatusesController, type: :controller do |
||||
render_views |
||||
|
||||
let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } |
@ -1,5 +0,0 @@ |
||||
require 'rails_helper' |
||||
|
||||
RSpec.describe Api::AccountsHelper, type: :helper do |
||||
|
||||
end |
@ -1,15 +0,0 @@ |
||||
require 'rails_helper' |
||||
|
||||
# Specs in this file have access to a helper object that includes |
||||
# the Api::AppsHelper. For example: |
||||
# |
||||
# describe Api::AppsHelper do |
||||
# describe "string concat" do |
||||
# it "concats two strings with spaces" do |
||||
# expect(helper.concat_strings("this","that")).to eq("this that") |
||||
# end |
||||
# end |
||||
# end |
||||
RSpec.describe Api::AppsHelper, type: :helper do |
||||
pending "add some examples to (or delete) #{__FILE__}" |
||||
end |
@ -1,5 +0,0 @@ |
||||
require 'rails_helper' |
||||
|
||||
RSpec.describe Api::FollowsHelper, type: :helper do |
||||
|
||||
end |
@ -1,5 +0,0 @@ |
||||
require 'rails_helper' |
||||
|
||||
RSpec.describe Api::MediaHelper, type: :helper do |
||||
|
||||
end |
@ -1,5 +0,0 @@ |
||||
require 'rails_helper' |
||||
|
||||
RSpec.describe Api::SalmonHelper, type: :helper do |
||||
|
||||
end |
@ -1,5 +0,0 @@ |
||||
require 'rails_helper' |
||||
|
||||
RSpec.describe Api::StatusesHelper, type: :helper do |
||||
|
||||
end |
@ -1,5 +0,0 @@ |
||||
require 'rails_helper' |
||||
|
||||
RSpec.describe Api::SubscriptionsHelper, type: :helper do |
||||
|
||||
end |
Loading…
Reference in new issue