2021-01-18 15:10:42 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe JiraConnectHelper do
|
|
|
|
describe '#jira_connect_app_data' do
|
2021-01-25 18:09:03 +00:00
|
|
|
let_it_be(:subscription) { create(:jira_connect_subscription) }
|
|
|
|
|
|
|
|
subject { helper.jira_connect_app_data([subscription]) }
|
2021-01-18 15:10:42 +00:00
|
|
|
|
|
|
|
it 'includes Jira Connect app attributes' do
|
|
|
|
is_expected.to include(
|
2021-01-25 18:09:03 +00:00
|
|
|
:groups_path,
|
|
|
|
:subscriptions_path
|
2021-01-18 15:10:42 +00:00
|
|
|
)
|
|
|
|
end
|
2021-01-25 18:09:03 +00:00
|
|
|
|
|
|
|
it 'passes group as "skip_groups" param' do
|
|
|
|
skip_groups_param = CGI.escape('skip_groups[]')
|
|
|
|
|
|
|
|
expect(subject[:groups_path]).to include("#{skip_groups_param}=#{subscription.namespace.id}")
|
|
|
|
end
|
2021-01-18 15:10:42 +00:00
|
|
|
end
|
|
|
|
end
|