diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-11 06:08:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-11 06:08:51 +0300 |
commit | cf127374b5f72c00426acad9f2432064eeb1f1e3 (patch) | |
tree | 710922928ab9888128a6c9f9dbc0edbf6ef2f8af /spec/presenters | |
parent | 7303dddd09bf28d28e36666f0cc2775e9fa27872 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/presenters')
-rw-r--r-- | spec/presenters/merge_request_presenter_spec.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/presenters/merge_request_presenter_spec.rb b/spec/presenters/merge_request_presenter_spec.rb index d0febf64035..b4210099e14 100644 --- a/spec/presenters/merge_request_presenter_spec.rb +++ b/spec/presenters/merge_request_presenter_spec.rb @@ -121,8 +121,8 @@ RSpec.describe MergeRequestPresenter do context 'issues links' do let_it_be(:project) { create(:project, :private, :repository, creator: user, namespace: user.namespace) } - let_it_be(:issue_a) { create(:issue, project: project) } - let_it_be(:issue_b) { create(:issue, project: project) } + let_it_be(:issue_a) { create(:issue, project: project, iid: 1) } + let_it_be(:issue_b) { create(:issue, project: project, iid: 3) } let_it_be(:resource) do create( @@ -143,6 +143,17 @@ RSpec.describe MergeRequestPresenter do resource.cache_merge_request_closes_issues! end + describe '#issues_sentence' do + let(:issue_c) { create(:issue, project: project, iid: 10) } + let(:issues) { [issue_b, issue_c, issue_a] } + + subject { described_class.new(resource, current_user: user).send(:issues_sentence, project, issues) } + + it 'orders issues numerically' do + is_expected.to eq("##{issue_a.iid}, ##{issue_b.iid}, and ##{issue_c.iid}") + end + end + describe '#closing_issues_links' do subject { described_class.new(resource, current_user: user).closing_issues_links } |