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/models/integrations/jira_spec.rb')
-rw-r--r--spec/models/integrations/jira_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/models/integrations/jira_spec.rb b/spec/models/integrations/jira_spec.rb
index 6ce84c28044..08656bfe543 100644
--- a/spec/models/integrations/jira_spec.rb
+++ b/spec/models/integrations/jira_spec.rb
@@ -109,6 +109,32 @@ RSpec.describe Integrations::Jira do
end
end
+ describe '#sections' do
+ let(:integration) { create(:jira_integration) }
+
+ subject(:sections) { integration.sections.map { |s| s[:type] } }
+
+ context 'when project_level? is true' do
+ before do
+ allow(integration).to receive(:project_level?).and_return(true)
+ end
+
+ it 'includes SECTION_TYPE_JIRA_ISSUES' do
+ expect(sections).to include(described_class::SECTION_TYPE_JIRA_ISSUES)
+ end
+ end
+
+ context 'when project_level? is false' do
+ before do
+ allow(integration).to receive(:project_level?).and_return(false)
+ end
+
+ it 'does not include SECTION_TYPE_JIRA_ISSUES' do
+ expect(sections).not_to include(described_class::SECTION_TYPE_JIRA_ISSUES)
+ end
+ end
+ end
+
describe '.reference_pattern' do
using RSpec::Parameterized::TableSyntax