diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/helpers/issues_helper_spec.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/helpers/issues_helper_spec.rb')
-rw-r--r-- | spec/helpers/issues_helper_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/helpers/issues_helper_spec.rb b/spec/helpers/issues_helper_spec.rb index 1ed61bd3144..07e55e9b016 100644 --- a/spec/helpers/issues_helper_spec.rb +++ b/spec/helpers/issues_helper_spec.rb @@ -254,4 +254,31 @@ RSpec.describe IssuesHelper do expect(helper.use_startup_call?).to eq(true) end end + + describe '#issue_header_actions_data' do + let(:current_user) { create(:user) } + + before do + allow(helper).to receive(:current_user).and_return(current_user) + allow(helper).to receive(:can?).and_return(true) + end + + it 'returns expected result' do + expected = { + can_create_issue: "true", + can_reopen_issue: "true", + can_report_spam: "false", + can_update_issue: "true", + iid: issue.iid, + is_issue_author: "false", + issue_type: "issue", + new_issue_path: new_project_issue_path(project), + project_path: project.full_path, + report_abuse_path: new_abuse_report_path(user_id: issue.author.id, ref_url: issue_url(issue)), + submit_as_spam_path: mark_as_spam_project_issue_path(project, issue) + } + + expect(helper.issue_header_actions_data(project, issue, current_user)).to include(expected) + end + end end |