diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/models/issue_spec.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r-- | spec/models/issue_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 594492a160d..48e19cd0ad5 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -380,6 +380,16 @@ RSpec.describe Issue, feature_category: :team_planning do end end + describe '.in_namespaces' do + let(:group) { create(:group) } + let!(:group_work_item) { create(:issue, :group_level, namespace: group) } + let!(:project_work_item) { create(:issue, project: reusable_project) } + + subject { described_class.in_namespaces(group) } + + it { is_expected.to contain_exactly(group_work_item) } + end + describe '.with_issue_type' do let_it_be(:issue) { create(:issue, project: reusable_project) } let_it_be(:incident) { create(:incident, project: reusable_project) } @@ -2195,4 +2205,21 @@ RSpec.describe Issue, feature_category: :team_planning do end end end + + describe '#gfm_reference' do + where(:issue_type, :expected_name) do + :issue | 'issue' + :incident | 'incident' + :test_case | 'test case' + :task | 'task' + end + + with_them do + it 'uses the issue type as the reference name' do + issue = create(:issue, issue_type, project: reusable_project) + + expect(issue.gfm_reference).to eq("#{expected_name} #{issue.to_reference}") + end + end + end end |