Commit 5a376063 authored by Toon Claes's avatar Toon Claes

Allow /copy_metadata for new issues

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/50181
parent 62dde350
......@@ -290,8 +290,7 @@ module QuickActions
end
params '#issue | !merge_request'
condition do
issuable.persisted? &&
current_user.can?(:"update_#{issuable.to_ability_name}", issuable)
current_user.can?(:"update_#{issuable.to_ability_name}", issuable)
end
parse_params do |issuable_param|
extract_references(issuable_param, :issue).first ||
......
---
title: Allow /copy_metadata for new issues and MRs
merge_request: 21953
author:
type: changed
# frozen_string_literal: true
require 'spec_helper'
describe QuickActions::InterpretService do
......@@ -859,6 +861,13 @@ describe QuickActions::InterpretService do
let(:issuable) { issue }
end
it_behaves_like 'copy_metadata command' do
let(:source_issuable) { create(:labeled_issue, project: project, labels: [inreview_label, todo_label]) }
let(:content) { "/copy_metadata #{source_issuable.to_reference}" }
let(:issuable) { build(:issue, project: project) }
end
it_behaves_like 'copy_metadata command' do
let(:source_issuable) { create(:labeled_issue, project: project, labels: [inreview_label, todo_label]) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment