2016-06-08 02:15:45 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Oauth::ApplicationsController do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
context 'project members' do
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'GET #index' do
|
|
|
|
it 'shows list of applications' do
|
|
|
|
get :index
|
|
|
|
|
2017-10-19 14:28:19 -04:00
|
|
|
expect(response).to have_gitlab_http_status(200)
|
2016-06-08 02:15:45 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'redirects back to profile page if OAuth applications are disabled' do
|
2018-02-02 13:39:55 -05:00
|
|
|
allow(Gitlab::CurrentSettings.current_application_settings).to receive(:user_oauth_applications?).and_return(false)
|
2016-06-08 02:15:45 -04:00
|
|
|
|
|
|
|
get :index
|
|
|
|
|
2017-10-19 14:28:19 -04:00
|
|
|
expect(response).to have_gitlab_http_status(302)
|
2016-06-08 02:15:45 -04:00
|
|
|
expect(response).to redirect_to(profile_path)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|