闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
633 B

  1. require 'rails_helper'
  2. RSpec.describe Oauth::AuthorizationsController, type: :controller do
  3. render_views
  4. let(:app) { Doorkeeper::Application.create!(name: 'test', redirect_uri: 'http://localhost/') }
  5. before do
  6. sign_in Fabricate(:user), scope: :user
  7. end
  8. describe 'GET #new' do
  9. before do
  10. get :new, params: { client_id: app.uid, response_type: 'code', redirect_uri: 'http://localhost/' }
  11. end
  12. it 'returns http success' do
  13. expect(response).to have_http_status(:success)
  14. end
  15. it 'gives options to authorize and deny' do
  16. expect(response.body).to match(/Authorize/)
  17. end
  18. end
  19. end