0
0
Fork 0

Fix #52 - Add API versioning (v1)

This commit is contained in:
Eugen Rochko 2016-09-27 16:58:23 +02:00
parent 3f75f52285
commit 4f9b7432dd
53 changed files with 77 additions and 134 deletions

View file

@ -1,26 +0,0 @@
require 'rails_helper'
RSpec.describe Api::AppsController, type: :controller do
render_views
describe 'POST #create' do
before do
post :create, params: { name: 'Test app', redirect_uri: 'urn:ietf:wg:oauth:2.0:oob' }
end
it 'returns http success' do
expect(response).to have_http_status(:success)
end
it 'creates an OAuth app' do
expect(Doorkeeper::Application.find_by(name: 'Test app')).to_not be nil
end
it 'returns client ID and client secret' do
json = body_as_json
expect(json[:client_id]).to_not be_blank
expect(json[:client_secret]).to_not be_blank
end
end
end