summaryrefslogtreecommitdiff
path: root/spec/helpers/issuables_helper_spec.rb
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-01-11 17:22:00 +0100
committerJan Provaznik <jprovaznik@gitlab.com>2018-01-18 12:27:02 +0100
commit4b6b8eccedb49014d4cd329a336015fb8d7bcff9 (patch)
tree3d6112c7aa65e03b1c44a1ad085ac33ec492684c /spec/helpers/issuables_helper_spec.rb
parenta4eb71dcfabbb27df1d4461cbb924ff1a4c3b1b8 (diff)
downloadgitlab-ce-4b6b8eccedb49014d4cd329a336015fb8d7bcff9.tar.gz
Return last edited time instead of update time41247-timestamp
For issuable models we keep two timestamps: updated_at which is updated whenever any model attribute is changed, last_edited_at which is changed when only title or description is changed. In UI bellow description we display who and when updated the item. But last_edited_by (used for 'who') is mistakenly combined with updated_at (when), last_edited_at should be used instead. Closes #41247
Diffstat (limited to 'spec/helpers/issuables_helper_spec.rb')
-rw-r--r--spec/helpers/issuables_helper_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb
index d601cbdb39b..8a01f7439d6 100644
--- a/spec/helpers/issuables_helper_spec.rb
+++ b/spec/helpers/issuables_helper_spec.rb
@@ -125,10 +125,10 @@ describe IssuablesHelper do
describe '#updated_at_by' do
let(:user) { create(:user) }
let(:unedited_issuable) { create(:issue) }
- let(:edited_issuable) { create(:issue, last_edited_by: user, created_at: 3.days.ago, updated_at: 2.days.ago, last_edited_at: 2.days.ago) }
+ let(:edited_issuable) { create(:issue, last_edited_by: user, created_at: 3.days.ago, updated_at: 1.day.ago, last_edited_at: 2.days.ago) }
let(:edited_updated_at_by) do
{
- updatedAt: edited_issuable.updated_at.to_time.iso8601,
+ updatedAt: edited_issuable.last_edited_at.to_time.iso8601,
updatedBy: {
name: user.name,
path: user_path(user)
@@ -142,7 +142,7 @@ describe IssuablesHelper do
context 'when updated by a deleted user' do
let(:edited_updated_at_by) do
{
- updatedAt: edited_issuable.updated_at.to_time.iso8601,
+ updatedAt: edited_issuable.last_edited_at.to_time.iso8601,
updatedBy: {
name: User.ghost.name,
path: user_path(User.ghost)