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/helpers/jira_connect_helper_spec.rb')
-rw-r--r--spec/helpers/jira_connect_helper_spec.rb32
1 files changed, 3 insertions, 29 deletions
diff --git a/spec/helpers/jira_connect_helper_spec.rb b/spec/helpers/jira_connect_helper_spec.rb
index 5ccb2dbaa41..4d2fc3d9ee6 100644
--- a/spec/helpers/jira_connect_helper_spec.rb
+++ b/spec/helpers/jira_connect_helper_spec.rb
@@ -4,8 +4,7 @@ require 'spec_helper'
RSpec.describe JiraConnectHelper do
describe '#jira_connect_app_data' do
- let_it_be(:installation) { create(:jira_connect_installation) }
- let_it_be(:subscription) { create(:jira_connect_subscription, installation: installation) }
+ let_it_be(:subscription) { create(:jira_connect_subscription) }
let(:user) { create(:user) }
let(:client_id) { '123' }
@@ -14,12 +13,11 @@ RSpec.describe JiraConnectHelper do
stub_application_setting(jira_connect_application_key: client_id)
end
- subject { helper.jira_connect_app_data([subscription], installation) }
+ subject { helper.jira_connect_app_data([subscription]) }
context 'user is not logged in' do
before do
allow(view).to receive(:current_user).and_return(nil)
- allow(Gitlab).to receive_message_chain('config.gitlab.host') { 'http://test.host' }
end
it 'includes Jira Connect app attributes' do
@@ -38,7 +36,7 @@ RSpec.describe JiraConnectHelper do
end
context 'with oauth_metadata' do
- let(:oauth_metadata) { helper.jira_connect_app_data([subscription], installation)[:oauth_metadata] }
+ let(:oauth_metadata) { helper.jira_connect_app_data([subscription])[:oauth_metadata] }
subject(:parsed_oauth_metadata) { Gitlab::Json.parse(oauth_metadata).deep_symbolize_keys }
@@ -76,30 +74,6 @@ RSpec.describe JiraConnectHelper do
expect(oauth_metadata).to be_nil
end
end
-
- context 'with self-managed instance' do
- let_it_be(:installation) { create(:jira_connect_installation, instance_url: 'https://gitlab.example.com') }
-
- it 'points urls to the self-managed instance' do
- expect(parsed_oauth_metadata).to include(
- oauth_authorize_url: start_with('https://gitlab.example.com/oauth/authorize?'),
- oauth_token_url: 'https://gitlab.example.com/oauth/token'
- )
- end
-
- context 'and jira_connect_oauth_self_managed feature is disabled' do
- before do
- stub_feature_flags(jira_connect_oauth_self_managed: false)
- end
-
- it 'does not point urls to the self-managed instance' do
- expect(parsed_oauth_metadata).not_to include(
- oauth_authorize_url: start_with('https://gitlab.example.com/oauth/authorize?'),
- oauth_token_url: 'https://gitlab.example.com/oauth/token'
- )
- end
- end
- end
end
it 'passes group as "skip_groups" param' do