diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-31 13:10:33 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-05-31 13:35:05 +0300 |
commit | 632d0c0a4c6ed8dd099f67a6914868811490e6a4 (patch) | |
tree | 8383fdad472c575fa8d04a5915e86709ff205498 /spec/helpers/issuables_helper_spec.rb | |
parent | 33d66a47f6da19831889d8717ec9f11b8b5c6b6c (diff) |
Remove EditableHelper and move method to IssuablesHelper
Diffstat (limited to 'spec/helpers/issuables_helper_spec.rb')
-rw-r--r-- | spec/helpers/issuables_helper_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb index c1ecb46aece..e55e489b02f 100644 --- a/spec/helpers/issuables_helper_spec.rb +++ b/spec/helpers/issuables_helper_spec.rb @@ -192,4 +192,22 @@ describe IssuablesHelper do expect(helper.issuable_filter_present?).to be_falsey end end + + 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_updated_at_by) do + { + updated_at: edited_issuable.updated_at.to_time.iso8601, + updated_by: { + name: user.name, + path: user_path(user) + } + } + end + + it { expect(helper.updated_at_by(unedited_issuable)).to eq({}) } + it { expect(helper.updated_at_by(edited_issuable)).to eq(edited_updated_at_by) } + end end |