summaryrefslogtreecommitdiff
path: root/spec/helpers/issuables_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 08:17:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 08:17:02 +0000
commitb39512ed755239198a9c294b6a45e65c05900235 (patch)
treed234a3efade1de67c46b9e5a38ce813627726aa7 /spec/helpers/issuables_helper_spec.rb
parentd31474cf3b17ece37939d20082b07f6657cc79a9 (diff)
downloadgitlab-ce-b39512ed755239198a9c294b6a45e65c05900235.tar.gz
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/helpers/issuables_helper_spec.rb')
-rw-r--r--spec/helpers/issuables_helper_spec.rb48
1 files changed, 46 insertions, 2 deletions
diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb
index 73527bea14e..069465c2fec 100644
--- a/spec/helpers/issuables_helper_spec.rb
+++ b/spec/helpers/issuables_helper_spec.rb
@@ -98,11 +98,55 @@ RSpec.describe IssuablesHelper do
end
end
- describe '#issuable_meta' do
+ describe '#issuable_meta', time_travel_to: '2022-08-05 00:00:00 +0000' do
let(:user) { create(:user) }
let_it_be(:project) { create(:project) }
+ describe 'Issuable created status text' do
+ subject { helper.issuable_meta(issuable, project) }
+
+ context 'when issuable is a work item and flag is off' do
+ using RSpec::Parameterized::TableSyntax
+
+ before do
+ stub_feature_flags(work_items: false)
+ end
+
+ where(:issuable_type, :text) do
+ :issue | 'Issue created Aug 05, 2022 by'
+ :incident | 'Incident created Aug 05, 2022 by'
+ end
+
+ let(:issuable) { build_stubbed(:work_item, issuable_type, created_at: Date.current) }
+
+ with_them do
+ it { is_expected.to have_content(text) }
+ end
+ end
+
+ context 'when issuable is a work item and flag is on' do
+ using RSpec::Parameterized::TableSyntax
+
+ where(:issuable_type, :text) do
+ :issue | 'Issue created Aug 05, 2022 by'
+ :incident | 'Incident created Aug 05, 2022 by'
+ end
+
+ let(:issuable) { build_stubbed(:work_item, issuable_type, created_at: Date.current) }
+
+ with_them do
+ it { is_expected.to have_content(text) }
+ end
+ end
+
+ context 'when issuable is not a work item' do
+ let(:issuable) { build_stubbed(:merge_request, created_at: Date.current) }
+
+ it { is_expected.to have_content('Created Aug 05, 2022') }
+ end
+ end
+
describe 'author status' do
let(:issuable) { build(:merge_request, source_project: project, author: user, created_at: '2020-01-30') }
@@ -299,7 +343,7 @@ RSpec.describe IssuablesHelper do
initialTitleText: issue.title,
initialDescriptionHtml: '<p dir="auto">issue text</p>',
initialDescriptionText: 'issue text',
- initialTaskStatus: '0 of 0 tasks completed',
+ initialTaskStatus: '0 of 0 checklist items completed',
issueType: 'issue',
iid: issue.iid.to_s,
isHidden: false