Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/jira_oauth_provider_authorize_spec.rb')
-rw-r--r--spec/features/jira_oauth_provider_authorize_spec.rb35
1 files changed, 28 insertions, 7 deletions
diff --git a/spec/features/jira_oauth_provider_authorize_spec.rb b/spec/features/jira_oauth_provider_authorize_spec.rb
index a542aaa7619..e873d9c219f 100644
--- a/spec/features/jira_oauth_provider_authorize_spec.rb
+++ b/spec/features/jira_oauth_provider_authorize_spec.rb
@@ -4,18 +4,39 @@ require 'spec_helper'
RSpec.describe 'JIRA OAuth Provider', feature_category: :integrations do
describe 'JIRA DVCS OAuth Authorization' do
- let(:application) { create(:oauth_application, redirect_uri: oauth_jira_dvcs_callback_url, scopes: 'read_user') }
+ let_it_be(:application) do
+ create(:oauth_application, redirect_uri: oauth_jira_dvcs_callback_url, scopes: 'read_user')
+ end
+
+ let(:authorize_path) do
+ oauth_jira_dvcs_authorize_path(client_id: application.uid,
+ redirect_uri: oauth_jira_dvcs_callback_url,
+ response_type: 'code',
+ state: 'my_state',
+ scope: 'read_user')
+ end
before do
sign_in(user)
+ end
- visit oauth_jira_dvcs_authorize_path(client_id: application.uid,
- redirect_uri: oauth_jira_dvcs_callback_url,
- response_type: 'code',
- state: 'my_state',
- scope: 'read_user')
+ it_behaves_like 'Secure OAuth Authorizations' do
+ before do
+ visit authorize_path
+ end
end
- it_behaves_like 'Secure OAuth Authorizations'
+ context 'when the flag is disabled' do
+ let_it_be(:user) { create(:user) }
+
+ before do
+ stub_feature_flags(jira_dvcs_end_of_life_amnesty: false)
+ visit authorize_path
+ end
+
+ it 'presents as an endpoint that does not exist' do
+ expect(page).to have_gitlab_http_status(:not_found)
+ end
+ end
end
end