diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-01 14:15:38 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-01 14:15:38 +0000 |
commit | 28b374eea4e2890514067ac7875b4c1d252c5cdd (patch) | |
tree | 9fe30ae35df4b83cee000e1a0880b390d88d80f0 /spec/helpers/events_helper_spec.rb | |
parent | c8fd9c521b89b98797cfd6e3a51cae6955129c20 (diff) | |
download | gitlab-ce-28b374eea4e2890514067ac7875b4c1d252c5cdd.tar.gz |
Add latest changes from gitlab-org/gitlab@15-3-stable-ee
Diffstat (limited to 'spec/helpers/events_helper_spec.rb')
-rw-r--r-- | spec/helpers/events_helper_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/helpers/events_helper_spec.rb b/spec/helpers/events_helper_spec.rb index 073cebeecd5..cc6804f0355 100644 --- a/spec/helpers/events_helper_spec.rb +++ b/spec/helpers/events_helper_spec.rb @@ -5,6 +5,25 @@ require 'spec_helper' RSpec.describe EventsHelper do include Gitlab::Routing + describe '#event_target_path' do + subject { helper.event_target_path(event.present) } + + context 'when target is a work item' do + let(:work_item) { create(:work_item) } + let(:event) { create(:event, target: work_item, target_type: 'WorkItem') } + + it { is_expected.to eq(Gitlab::UrlBuilder.build(work_item, only_path: true)) } + end + + context 'when target is not a work item' do + let(:project) { create(:project) } + let(:issue) { create(:issue, project: project) } + let(:event) { create(:event, target: issue, project: project) } + + it { is_expected.to eq([project, issue]) } + end + end + describe '#event_commit_title' do let(:message) { 'foo & bar ' + 'A' * 70 + '\n' + 'B' * 80 } |