summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-31 11:10:33 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-31 11:35:05 +0100
commit632d0c0a4c6ed8dd099f67a6914868811490e6a4 (patch)
tree8383fdad472c575fa8d04a5915e86709ff205498 /spec/helpers
parent33d66a47f6da19831889d8717ec9f11b8b5c6b6c (diff)
downloadgitlab-ce-632d0c0a4c6ed8dd099f67a6914868811490e6a4.tar.gz
Remove EditableHelper and move method to IssuablesHelper
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/editable_helper_spec.rb21
-rw-r--r--spec/helpers/issuables_helper_spec.rb18
2 files changed, 18 insertions, 21 deletions
diff --git a/spec/helpers/editable_helper_spec.rb b/spec/helpers/editable_helper_spec.rb
deleted file mode 100644
index fe7a3bccd4b..00000000000
--- a/spec/helpers/editable_helper_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-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.to_time.iso8601,
- updated_by: {
- name: user.name,
- path: user_path(user)
- }
- }
- end
-
- it { expect(helper.updated_at_by(unedited_editable)).to eq({}) }
- it { expect(helper.updated_at_by(edited_editable)).to eq(edited_updated_at_by) }
- end
-end
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