From 442f9d6eb2537e0e9343710640d68dea73cbc1c4 Mon Sep 17 00:00:00 2001 From: Peter Leitzen <pleitzen@gitlab.com> Date: Tue, 13 Jun 2023 14:49:28 +0200 Subject: [PATCH] Allow work items to be presented via WorkItemPresenter --- app/presenters/work_item_presenter.rb | 4 ++++ spec/presenters/work_item_presenter_spec.rb | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 app/presenters/work_item_presenter.rb create mode 100644 spec/presenters/work_item_presenter_spec.rb diff --git a/app/presenters/work_item_presenter.rb b/app/presenters/work_item_presenter.rb new file mode 100644 index 0000000000000..995f2d02156d7 --- /dev/null +++ b/app/presenters/work_item_presenter.rb @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +class WorkItemPresenter < IssuePresenter # rubocop:todo Gitlab/NamespacedClass +end diff --git a/spec/presenters/work_item_presenter_spec.rb b/spec/presenters/work_item_presenter_spec.rb new file mode 100644 index 0000000000000..522ffd832c18d --- /dev/null +++ b/spec/presenters/work_item_presenter_spec.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe WorkItemPresenter, feature_category: :portfolio_management do + let(:work_item) { build_stubbed(:work_item) } + + it 'presents a work item and uses methods defined in IssuePresenter' do + user = build_stubbed(:user) + presenter = work_item.present(current_user: user) + + expect(presenter.issue_path).to eq(presenter.web_path) + end +end -- GitLab