Move OAuth flow tests from feature tests to system tests (#29837)
parent
b61ae28f8d
commit
e73cf356d2
|
@ -3,13 +3,14 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe 'Using OAuth from an external app' do
|
describe 'Using OAuth from an external app' do
|
||||||
let(:client_app) { Doorkeeper::Application.create!(name: 'test', redirect_uri: 'http://localhost/', scopes: 'read') }
|
let(:client_app) { Doorkeeper::Application.create!(name: 'test', redirect_uri: 'http://localhost/health', scopes: 'read') }
|
||||||
|
|
||||||
context 'when the user is already logged in' do
|
context 'when the user is already logged in' do
|
||||||
let!(:user) { Fabricate(:user) }
|
let!(:user) { Fabricate(:user) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
sign_in user, scope: :user
|
visit new_user_session_path
|
||||||
|
fill_in_auth_details(user.email, user.password)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'when accepting the authorization request' do
|
it 'when accepting the authorization request' do
|
||||||
|
@ -164,6 +165,8 @@ describe 'Using OAuth from an external app' do
|
||||||
expect(Doorkeeper::AccessGrant.exists?(application: client_app, resource_owner_id: user.id)).to be false
|
expect(Doorkeeper::AccessGrant.exists?(application: client_app, resource_owner_id: user.id)).to be false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
# TODO: external auth
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
@ -177,7 +180,4 @@ describe 'Using OAuth from an external app' do
|
||||||
fill_in 'user_otp_attempt', with: value
|
fill_in 'user_otp_attempt', with: value
|
||||||
click_on I18n.t('auth.login')
|
click_on I18n.t('auth.login')
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO: external auth
|
|
||||||
end
|
|
||||||
end
|
end
|
Loading…
Reference in New Issue