Skip to content
代码片段 群组 项目
提交 90e97542 编辑于 作者: charlie ablett's avatar charlie ablett
浏览文件

Merge branch 'cherry-pick-4c686b45' into '16-2-stable-ee'

Merge branch '418983-fix-issue-type-update' into 'master'

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127238



Merged-by: default avatarcharlie ablett <cablett@gitlab.com>
Approved-by: default avatarcharlie ablett <cablett@gitlab.com>
No related branches found
No related tags found
1 合并请求!1902Prepare 16.2.2 release for gitlab-jh
...@@ -334,6 +334,7 @@ def render_issue_json ...@@ -334,6 +334,7 @@ def render_issue_json
end end
def issue_params def issue_params
params[:issue][:issue_type] ||= params[:issue_type] if params[:issue_type].present?
all_params = params.require(:issue).permit( all_params = params.require(:issue).permit(
*issue_params_attributes, *issue_params_attributes,
sentry_issue_attributes: [:sentry_issue_identifier] sentry_issue_attributes: [:sentry_issue_identifier]
......
...@@ -7,13 +7,20 @@ ...@@ -7,13 +7,20 @@
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:developer) { create(:user) } let_it_be(:developer) { create(:user) }
let_it_be(:incident) { create(:incident, project: project, author: developer, description: 'description') }
let_it_be(:issue) { create(:issue, project: project, author: developer, description: 'Issue description') }
let_it_be(:escalation_status) { create(:incident_management_issuable_escalation_status, issue: incident) }
let_it_be(:confidential_incident) do let_it_be(:confidential_incident) do
create(:incident, confidential: true, project: project, author: developer, description: 'Confidential') create(:incident, confidential: true, project: project, author: developer, description: 'Confidential')
end end
let_it_be_with_reload(:incident) do
create(:incident, project: project, author: developer, description: 'description')
end
let_it_be(:escalation_status) { create(:incident_management_issuable_escalation_status, issue: incident) }
let_it_be_with_reload(:issue) do
create(:issue, project: project, author: developer, description: 'Issue description')
end
before_all do before_all do
project.add_developer(developer) project.add_developer(developer)
end end
...@@ -105,12 +112,15 @@ def current_status ...@@ -105,12 +112,15 @@ def current_status
page.within('[data-testid="issuable-form"]') do page.within('[data-testid="issuable-form"]') do
click_button 'Issue' click_button 'Issue'
find('[data-testid="issue-type-list-item"]', text: 'Incident').click find('[data-testid="issue-type-list-item"]', text: 'Incident').click
click_button 'Save changes' click_button 'Save changes'
end
wait_for_requests wait_for_requests
expect(page).to have_current_path("#{project_path}/-/issues/incident/#{issue.iid}") expect(issue.reload.issue_type).to eq('incident')
end expect(page).to have_current_path("#{project_path}/-/issues/incident/#{issue.iid}")
expect(page).to have_content(issue.title)
end end
it 'routes the user to the issue details page when the `issue_type` is set to issue' do it 'routes the user to the issue details page when the `issue_type` is set to issue' do
...@@ -126,11 +136,13 @@ def current_status ...@@ -126,11 +136,13 @@ def current_status
click_button 'Incident' click_button 'Incident'
find('[data-testid="issue-type-list-item"]', text: 'Issue').click find('[data-testid="issue-type-list-item"]', text: 'Issue').click
click_button 'Save changes' click_button 'Save changes'
end
wait_for_requests wait_for_requests
expect(page).to have_current_path("#{project_path}/-/issues/#{incident.iid}") expect(incident.reload.issue_type).to eq('issue')
end expect(page).to have_current_path("#{project_path}/-/issues/#{incident.iid}")
expect(page).to have_content(incident.title)
end end
it 'displays the confidential badge on the sticky header when the incident is confidential' do it 'displays the confidential badge on the sticky header when the incident is confidential' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册