summaryrefslogtreecommitdiff
path: root/spec/helpers/issues_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/issues_helper_spec.rb')
-rw-r--r--spec/helpers/issues_helper_spec.rb47
1 files changed, 8 insertions, 39 deletions
diff --git a/spec/helpers/issues_helper_spec.rb b/spec/helpers/issues_helper_spec.rb
index ed363268cdf..0024d6b7b4e 100644
--- a/spec/helpers/issues_helper_spec.rb
+++ b/spec/helpers/issues_helper_spec.rb
@@ -266,7 +266,9 @@ RSpec.describe IssuesHelper do
issue_type: 'issue',
new_issue_path: new_project_issue_path(project, { add_related_issue: issue.iid }),
project_path: project.full_path,
- report_abuse_path: new_abuse_report_path(user_id: issue.author.id, ref_url: issue_url(issue)),
+ report_abuse_path: add_category_abuse_reports_path,
+ reported_user_id: issue.author.id,
+ reported_from_url: issue_url(issue),
submit_as_spam_path: mark_as_spam_project_issue_path(project, issue)
}
@@ -389,8 +391,12 @@ RSpec.describe IssuesHelper do
allow(helper).to receive(:url_for).and_return('#')
expected = {
+ autocomplete_award_emojis_path: autocomplete_award_emojis_path,
calendar_path: '#',
- empty_state_svg_path: '#',
+ dashboard_labels_path: dashboard_labels_path(format: :json, include_ancestor_groups: true),
+ dashboard_milestones_path: dashboard_milestones_path(format: :json),
+ empty_state_with_filter_svg_path: '#',
+ empty_state_without_filter_svg_path: '#',
initial_sort: current_user&.user_preference&.issues_sort,
is_public_visibility_restricted: Gitlab::CurrentSettings.restricted_visibility_levels ? 'false' : '',
is_signed_in: current_user.present?.to_s,
@@ -472,43 +478,6 @@ RSpec.describe IssuesHelper do
end
end
- describe '#status_box_class' do
- context 'when object is expired' do
- it 'returns orange background' do
- milestone = build(:milestone, due_date: Date.today.prev_month)
- expect(helper.status_box_class(milestone)).to eq('gl-bg-orange-500')
- end
- end
-
- context 'when object is merged' do
- it 'returns blue background' do
- merge_request = build(:merge_request, :merged)
- expect(helper.status_box_class(merge_request)).to eq('badge-info')
- end
- end
-
- context 'when object is closed' do
- it 'returns red background' do
- merge_request = build(:merge_request, :closed)
- expect(helper.status_box_class(merge_request)).to eq('badge-danger')
- end
- end
-
- context 'when object is upcoming' do
- it 'returns gray background' do
- milestone = build(:milestone, start_date: Date.today.next_month)
- expect(helper.status_box_class(milestone)).to eq('gl-bg-gray-500')
- end
- end
-
- context 'when object is opened' do
- it 'returns green background' do
- merge_request = build(:merge_request, :opened)
- expect(helper.status_box_class(merge_request)).to eq('badge-success')
- end
- end
- end
-
describe '#issue_hidden?' do
context 'when issue is hidden' do
let_it_be(:banned_user) { build(:user, :banned) }