diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-12 18:10:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-12 18:10:26 +0300 |
commit | c0b17cee8be646588b14db49ad6d91b8cc818f97 (patch) | |
tree | 97287971303bccd649da1718c1a3a1ba8f345df6 /spec/models | |
parent | 8ef107c43390ea9c9932afb55d1318e4716fbf3b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/issue_link_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/issue_link_spec.rb b/spec/models/issue_link_spec.rb index 9f77fcef5da..d69a3f2954c 100644 --- a/spec/models/issue_link_spec.rb +++ b/spec/models/issue_link_spec.rb @@ -41,5 +41,19 @@ RSpec.describe IssueLink do expect(result).to contain_exactly(issue_link_1, issue_link_2) end end + + describe '.for_issues' do + let_it_be(:issue) { create(:issue) } + let_it_be(:source_link) { create(:issue_link, source: issue, target: issue1) } + let_it_be(:target_link) { create(:issue_link, source: issue2, target: issue) } + + it 'includes links when issue is source' do + expect(described_class.for_issues(issue, issue1)).to contain_exactly(source_link) + end + + it 'includes links when issue is target' do + expect(described_class.for_issues(issue, issue2)).to contain_exactly(target_link) + end + end end end |