Commit 63cea671 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'pherlihy-master-patch-95213' into 'master'

Touch merge request updated_at when assignees changed

Closes #244201

See merge request gitlab-org/gitlab!41030
parents 402bca52 d6167735
# frozen_string_literal: true # frozen_string_literal: true
class MergeRequestAssignee < ApplicationRecord class MergeRequestAssignee < ApplicationRecord
belongs_to :merge_request belongs_to :merge_request, touch: true
belongs_to :assignee, class_name: "User", foreign_key: :user_id, inverse_of: :merge_request_assignees belongs_to :assignee, class_name: "User", foreign_key: :user_id, inverse_of: :merge_request_assignees
validates :assignee, uniqueness: { scope: :merge_request_id } validates :assignee, uniqueness: { scope: :merge_request_id }
......
---
title: Change merge request updated_at when assignees are changed
merge_request: 41030
author: Patrick Herlihy
type: fixed
...@@ -21,6 +21,10 @@ RSpec.describe 'Merge request > User assigns themselves' do ...@@ -21,6 +21,10 @@ RSpec.describe 'Merge request > User assigns themselves' do
expect(page).to have_content '2 issues have been assigned to you' expect(page).to have_content '2 issues have been assigned to you'
end end
it 'updates updated_by', :js do
expect { click_button 'assign yourself' }.to change { merge_request.reload.updated_at }
end
it 'returns user to the merge request', :js do it 'returns user to the merge request', :js do
click_link 'Assign yourself to these issues' click_link 'Assign yourself to these issues'
......
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