summaryrefslogtreecommitdiff
path: root/spec/controllers/oauth/applications_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/oauth/applications_controller_spec.rb')
-rw-r--r--spec/controllers/oauth/applications_controller_spec.rb27
1 files changed, 23 insertions, 4 deletions
diff --git a/spec/controllers/oauth/applications_controller_spec.rb b/spec/controllers/oauth/applications_controller_spec.rb
index 5bf3b4c48bf..9b16dc9a463 100644
--- a/spec/controllers/oauth/applications_controller_spec.rb
+++ b/spec/controllers/oauth/applications_controller_spec.rb
@@ -113,11 +113,30 @@ RSpec.describe Oauth::ApplicationsController do
subject { post :create, params: oauth_params }
- it 'creates an application' do
- subject
+ context 'when hash_oauth_tokens flag set' do
+ before do
+ stub_feature_flags(hash_oauth_secrets: true)
+ end
- expect(response).to have_gitlab_http_status(:found)
- expect(response).to redirect_to(oauth_application_path(Doorkeeper::Application.last))
+ it 'creates an application' do
+ subject
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(response).to render_template :show
+ end
+ end
+
+ context 'when hash_oauth_tokens flag not set' do
+ before do
+ stub_feature_flags(hash_oauth_secrets: false)
+ end
+
+ it 'creates an application' do
+ subject
+
+ expect(response).to have_gitlab_http_status(:found)
+ expect(response).to redirect_to(oauth_application_path(Doorkeeper::Application.last))
+ end
end
it 'redirects back to profile page if OAuth applications are disabled' do