diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/controllers/jira_connect/app_descriptor_controller_spec.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/controllers/jira_connect/app_descriptor_controller_spec.rb')
-rw-r--r-- | spec/controllers/jira_connect/app_descriptor_controller_spec.rb | 81 |
1 files changed, 74 insertions, 7 deletions
diff --git a/spec/controllers/jira_connect/app_descriptor_controller_spec.rb b/spec/controllers/jira_connect/app_descriptor_controller_spec.rb index 55bafa938a7..98f4db13a1d 100644 --- a/spec/controllers/jira_connect/app_descriptor_controller_spec.rb +++ b/spec/controllers/jira_connect/app_descriptor_controller_spec.rb @@ -4,20 +4,87 @@ require 'spec_helper' RSpec.describe JiraConnect::AppDescriptorController do describe '#show' do + let(:descriptor) do + json_response.deep_symbolize_keys + end + + let(:logo_url) { %r{\Ahttp://test\.host/assets/gitlab_logo-\h+\.png\z} } + + let(:common_module_properties) do + { + homeUrl: 'https://gitlab.com', + logoUrl: logo_url, + documentationUrl: 'https://docs.gitlab.com/ee/integration/jira/' + } + end + it 'returns JSON app descriptor' do get :show expect(response).to have_gitlab_http_status(:ok) - expect(json_response).to include( - 'baseUrl' => 'https://test.host/-/jira_connect', - 'lifecycle' => { - 'installed' => '/events/installed', - 'uninstalled' => '/events/uninstalled' + + expect(descriptor).to include( + name: Atlassian::JiraConnect.app_name, + description: kind_of(String), + key: Atlassian::JiraConnect.app_key, + baseUrl: 'https://test.host/-/jira_connect', + lifecycle: { + installed: '/events/installed', + uninstalled: '/events/uninstalled' + }, + vendor: { + name: 'GitLab', + url: 'https://gitlab.com' }, - 'links' => { - 'documentation' => 'http://test.host/help/integration/jira_development_panel#gitlabcom-1' + links: { + documentation: 'http://test.host/help/integration/jira_development_panel#gitlabcom-1' + }, + authentication: { + type: 'jwt' + }, + scopes: %w(READ WRITE DELETE), + apiVersion: 1, + apiMigrations: { + 'context-qsh': true, + gdpr: true } ) + + expect(descriptor[:modules]).to include( + postInstallPage: { + key: 'gitlab-configuration', + name: { value: 'GitLab Configuration' }, + url: '/subscriptions' + }, + jiraDevelopmentTool: { + actions: { + createBranch: { + templateUrl: 'http://test.host/-/jira_connect/branches/new?issue_key={issue.key}&issue_summary={issue.summary}' + } + }, + key: 'gitlab-development-tool', + application: { value: 'GitLab' }, + name: { value: 'GitLab' }, + url: 'https://gitlab.com', + logoUrl: logo_url, + capabilities: %w(branch commit pull_request) + }, + jiraBuildInfoProvider: common_module_properties.merge( + actions: {}, + name: { value: 'GitLab CI' }, + key: 'gitlab-ci' + ), + jiraDeploymentInfoProvider: common_module_properties.merge( + actions: {}, + name: { value: 'GitLab Deployments' }, + key: 'gitlab-deployments' + ), + jiraFeatureFlagInfoProvider: common_module_properties.merge( + actions: {}, + name: { value: 'GitLab Feature Flags' }, + key: 'gitlab-feature-flags' + ) + ) end end end |