summaryrefslogtreecommitdiff
path: root/spec/requests/jira_connect
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-19 23:18:09 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-19 23:18:09 +0000
commit6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch)
treedc4d20fe6064752c0bd323187252c77e0a89144b /spec/requests/jira_connect
parent9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff)
downloadgitlab-ce-6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde.tar.gz
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/requests/jira_connect')
-rw-r--r--spec/requests/jira_connect/oauth_callbacks_controller_spec.rb6
-rw-r--r--spec/requests/jira_connect/subscriptions_controller_spec.rb21
2 files changed, 16 insertions, 11 deletions
diff --git a/spec/requests/jira_connect/oauth_callbacks_controller_spec.rb b/spec/requests/jira_connect/oauth_callbacks_controller_spec.rb
index 1e4628e5d59..12b9429b648 100644
--- a/spec/requests/jira_connect/oauth_callbacks_controller_spec.rb
+++ b/spec/requests/jira_connect/oauth_callbacks_controller_spec.rb
@@ -5,12 +5,6 @@ require 'spec_helper'
RSpec.describe JiraConnect::OauthCallbacksController do
describe 'GET /-/jira_connect/oauth_callbacks' do
context 'when logged in' do
- let_it_be(:user) { create(:user) }
-
- before do
- sign_in(user)
- end
-
it 'renders a page prompting the user to close the window' do
get '/-/jira_connect/oauth_callbacks'
diff --git a/spec/requests/jira_connect/subscriptions_controller_spec.rb b/spec/requests/jira_connect/subscriptions_controller_spec.rb
index d8f329f13f5..f407ea09250 100644
--- a/spec/requests/jira_connect/subscriptions_controller_spec.rb
+++ b/spec/requests/jira_connect/subscriptions_controller_spec.rb
@@ -12,18 +12,29 @@ RSpec.describe JiraConnect::SubscriptionsController do
let(:jwt) { Atlassian::Jwt.encode({ iss: installation.client_key, qsh: qsh }, installation.shared_secret) }
- before do
+ subject(:content_security_policy) do
get '/-/jira_connect/subscriptions', params: { jwt: jwt }
- end
- subject(:content_security_policy) { response.headers['Content-Security-Policy'] }
+ response.headers['Content-Security-Policy']
+ end
- it { is_expected.to include('http://self-managed-gitlab.com/-/jira_connect/oauth_application_ids') }
+ it { is_expected.to include('http://self-managed-gitlab.com/-/jira_connect/') }
+ it { is_expected.to include('http://self-managed-gitlab.com/api/') }
context 'with no self-managed instance configured' do
let_it_be(:installation) { create(:jira_connect_installation, instance_url: '') }
- it { is_expected.not_to include('http://self-managed-gitlab.com') }
+ it { is_expected.not_to include('http://self-managed-gitlab.com/-/jira_connect/') }
+ it { is_expected.not_to include('http://self-managed-gitlab.com/api/') }
+ end
+
+ context 'with jira_connect_oauth_self_managed feature disabled' do
+ before do
+ stub_feature_flags(jira_connect_oauth_self_managed: false)
+ end
+
+ it { is_expected.not_to include('http://self-managed-gitlab.com/-/jira_connect/') }
+ it { is_expected.not_to include('http://self-managed-gitlab.com/api/') }
end
end
end