闭社主体 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.

27 lines
664 B

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