BigW Consortium Gitlab

Correct editable_helper spec and format issuable_app_data updated_at to iso8061

parent aa1d87bd
...@@ -3,7 +3,7 @@ module EditableHelper ...@@ -3,7 +3,7 @@ module EditableHelper
return {} unless editable.is_edited? return {} unless editable.is_edited?
{ {
updated_at: editable.updated_at, updated_at: editable.updated_at.to_time.iso8601,
updated_by: { updated_by: {
name: editable.last_edited_by.name, name: editable.last_edited_by.name,
path: user_path(editable.last_edited_by) path: user_path(editable.last_edited_by)
......
...@@ -7,7 +7,7 @@ describe EditableHelper do ...@@ -7,7 +7,7 @@ describe EditableHelper do
let(:edited_editable) { create(:issue, last_edited_by: user, created_at: 3.days.ago, updated_at: 2.days.ago, last_edited_at: 2.days.ago) } let(:edited_editable) { create(:issue, last_edited_by: user, created_at: 3.days.ago, updated_at: 2.days.ago, last_edited_at: 2.days.ago) }
let(:edited_updated_at_by) do let(:edited_updated_at_by) do
{ {
updated_at: edited_editable.updated_at, updated_at: edited_editable.updated_at.to_time.iso8601,
updated_by: { updated_by: {
name: user.name, name: user.name,
path: user_path(user) path: user_path(user)
...@@ -15,7 +15,7 @@ describe EditableHelper do ...@@ -15,7 +15,7 @@ describe EditableHelper do
} }
end end
it { expect(helper.updated_at_by(unedited_editable)).to be_nil } it { expect(helper.updated_at_by(unedited_editable)).to eq({}) }
it { expect(helper.updated_at_by(edited_editable)).to eq(edited_updated_at_by) } it { expect(helper.updated_at_by(edited_editable)).to eq(edited_updated_at_by) }
end end
end end
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