diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-15 03:10:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-15 03:10:51 +0300 |
commit | d9749000e7835a56d960b4768abe783dca37f37e (patch) | |
tree | 1899ba4f5586ffb45e26162c45c6df2d3553dd42 /spec/models | |
parent | 4b5042946065b750131e51790b84fe4a5aa7aa02 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/concerns/has_integrations_spec.rb | 25 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 14 |
2 files changed, 14 insertions, 25 deletions
diff --git a/spec/models/concerns/has_integrations_spec.rb b/spec/models/concerns/has_integrations_spec.rb deleted file mode 100644 index 5a227ed1a57..00000000000 --- a/spec/models/concerns/has_integrations_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe HasIntegrations do - let_it_be(:project_1) { create(:project) } - let_it_be(:project_2) { create(:project) } - let_it_be(:project_3) { create(:project) } - let_it_be(:project_4) { create(:project) } - let_it_be(:instance_integration) { create(:jira_integration, :instance) } - - before do - create(:jira_integration, project: project_1, inherit_from_id: instance_integration.id) - create(:jira_integration, project: project_2, inherit_from_id: nil) - create(:jira_integration, :group, group: create(:group), inherit_from_id: nil) - create(:jira_integration, project: project_3, inherit_from_id: nil) - create(:integrations_slack, project: project_4, inherit_from_id: nil) - end - - describe '.without_integration' do - it 'returns projects without integration' do - expect(Project.without_integration(instance_integration)).to contain_exactly(project_4) - end - end -end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 109504ae1d8..8a4e485a298 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1864,6 +1864,20 @@ RSpec.describe Project, factory_default: :keep do end end + describe '.without_integration' do + it 'returns projects without the integration' do + project_1, project_2, project_3, project_4 = create_list(:project, 4) + instance_integration = create(:jira_integration, :instance) + create(:jira_integration, project: project_1, inherit_from_id: instance_integration.id) + create(:jira_integration, project: project_2, inherit_from_id: nil) + create(:jira_integration, group: create(:group), project: nil, inherit_from_id: nil) + create(:jira_integration, project: project_3, inherit_from_id: nil) + create(:integrations_slack, project: project_4, inherit_from_id: nil) + + expect(Project.without_integration(instance_integration)).to contain_exactly(project_4) + end + end + context 'repository storage by default' do let(:project) { build(:project) } |