diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-18 15:24:34 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-31 13:35:05 +0300 |
commit | 07c984d81cd7985d4ab7597cbb21b5f623b438e9 (patch) | |
tree | 8296ba468bad7e2d62f8d82d6dcbfac5fa5a659e /spec/helpers | |
parent | 228926daee799c95e752a3c284c860e5bc60e528 (diff) |
Port fix-realtime-edited-text-for-issues 9-2-stable fix to master.
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/editable_helper_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/helpers/editable_helper_spec.rb b/spec/helpers/editable_helper_spec.rb new file mode 100644 index 00000000000..81d2c33ccca --- /dev/null +++ b/spec/helpers/editable_helper_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe EditableHelper do + describe '#updated_at_by' do + let(:user) { create(:user) } + let(:unedited_editable) { create(:issue) } + 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 + { + updated_at: edited_editable.updated_at, + updated_by: { + name: user.name, + path: user_path(user) + } + } + end + + it { expect(helper.updated_at_by(unedited_editable)).to eq(nil) } + + it { expect(helper.updated_at_by(edited_editable)).to eq(edited_updated_at_by) } + end +end |