mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 09:04:00 -05:00
9566893cc9
* Add render_views in more places * Delegate methods from account to user with allow nil true, so that admin accounts show view renders when missing a user * Use actual account instances in authorize follow controller spec
28 lines
664 B
Ruby
28 lines
664 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe Oauth::AuthorizationsController, type: :controller do
|
|
render_views
|
|
|
|
let(:app) { Doorkeeper::Application.create!(name: 'test', redirect_uri: 'http://localhost/') }
|
|
|
|
before do
|
|
sign_in Fabricate(:user), scope: :user
|
|
end
|
|
|
|
describe 'GET #new' do
|
|
before do
|
|
get :new, params: { client_id: app.uid, response_type: 'code', redirect_uri: 'http://localhost/' }
|
|
end
|
|
|
|
it 'returns http success' do
|
|
expect(response).to have_http_status(:success)
|
|
end
|
|
|
|
it 'gives options to authorize and deny' do
|
|
expect(response.body).to match(/Authorize/)
|
|
end
|
|
end
|
|
end
|