summaryrefslogtreecommitdiff
path: root/spec/models/integrations/jira_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-30 04:50:46 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-30 04:50:46 +0000
commite6572d41b847c839ce49bc022a8cd1b99216798b (patch)
tree419eeffb09aafcd9d5a82e43c823b8cfbf88963e /spec/models/integrations/jira_spec.rb
parent1f6654659564013b8aa4f3572158cb63d3a519c1 (diff)
downloadgitlab-ce-e6572d41b847c839ce49bc022a8cd1b99216798b.tar.gz
Add latest changes from gitlab-org/security/gitlab@15-6-stable-ee
Diffstat (limited to 'spec/models/integrations/jira_spec.rb')
-rw-r--r--spec/models/integrations/jira_spec.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/models/integrations/jira_spec.rb b/spec/models/integrations/jira_spec.rb
index 819dad9d46d..af1112cf50d 100644
--- a/spec/models/integrations/jira_spec.rb
+++ b/spec/models/integrations/jira_spec.rb
@@ -230,9 +230,12 @@ RSpec.describe Integrations::Jira do
where(:url, :result) do
'https://abc.atlassian.net' | true
+ 'http://abc.atlassian.net' | false
'abc.atlassian.net' | false # This is how it behaves currently, but we may need to consider adding scheme if missing
'https://somethingelse.com' | false
- nil | false
+ 'javascript://test.atlassian.net/%250dalert(document.domain)' | false
+ 'https://example.com".atlassian.net' | false
+ nil | false
end
with_them do
@@ -289,7 +292,7 @@ RSpec.describe Integrations::Jira do
let(:server_info_results) { { 'deploymentType' => 'FutureCloud' } }
context 'and URL ends in .atlassian.net' do
- let(:api_url) { 'http://example-api.atlassian.net' }
+ let(:api_url) { 'https://example-api.atlassian.net' }
it 'deployment_type is set to cloud' do
expect(integration.jira_tracker_data).to be_deployment_cloud
@@ -297,7 +300,7 @@ RSpec.describe Integrations::Jira do
end
context 'and URL is something else' do
- let(:api_url) { 'http://my-jira-api.someserver.com' }
+ let(:api_url) { 'https://my-jira-api.someserver.com' }
it 'deployment_type is set to server' do
expect(integration.jira_tracker_data).to be_deployment_server
@@ -309,7 +312,7 @@ RSpec.describe Integrations::Jira do
let(:server_info_results) { {} }
context 'and URL ends in .atlassian.net' do
- let(:api_url) { 'http://example-api.atlassian.net' }
+ let(:api_url) { 'https://example-api.atlassian.net' }
it 'deployment_type is set to cloud' do
expect(Gitlab::AppLogger).to receive(:warn).with(message: "Jira API returned no ServerInfo, setting deployment_type from URL", server_info: server_info_results, url: api_url)
@@ -318,7 +321,7 @@ RSpec.describe Integrations::Jira do
end
context 'and URL is something else' do
- let(:api_url) { 'http://my-jira-api.someserver.com' }
+ let(:api_url) { 'https://my-jira-api.someserver.com' }
it 'deployment_type is set to server' do
expect(Gitlab::AppLogger).to receive(:warn).with(message: "Jira API returned no ServerInfo, setting deployment_type from URL", server_info: server_info_results, url: api_url)