diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-07-19 19:19:32 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-07-19 19:19:32 +0300 |
commit | c6e979587af7cf8d85b4e97a8771d44aa04f3ef4 (patch) | |
tree | cd33f2ed61a0fb375228025de16f4065d0c233e9 /spec/helpers | |
parent | b042765d2f56e6a7c64c2563bba2f795fde439bf (diff) | |
parent | a9d940bffcf7447f8d62012bd1c8f866697a12d6 (diff) |
Merge branch '34930-fix-edited-by' into 'master'
Fix issue detail if user who last edited an issue was deleted
Closes #34930
See merge request !12933
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/issuables_helper_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb index b423a09873b..7789cfa3554 100644 --- a/spec/helpers/issuables_helper_spec.rb +++ b/spec/helpers/issuables_helper_spec.rb @@ -244,5 +244,25 @@ describe IssuablesHelper do it { expect(helper.updated_at_by(unedited_issuable)).to eq({}) } it { expect(helper.updated_at_by(edited_issuable)).to eq(edited_updated_at_by) } + + context 'when updated by a deleted user' do + let(:edited_updated_at_by) do + { + updatedAt: edited_issuable.updated_at.to_time.iso8601, + updatedBy: { + name: User.ghost.name, + path: user_path(User.ghost) + } + } + end + + before do + user.destroy + end + + it 'returns "Ghost user" as edited_by' do + expect(helper.updated_at_by(edited_issuable.reload)).to eq(edited_updated_at_by) + end + end end end |