summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-01-20 15:06:49 +0000
committerDouwe Maan <douwe@gitlab.com>2016-01-20 15:06:49 +0000
commitb4faa59728c07893fe0f6d83648bf4d76e36320a (patch)
tree91ddc330527189518eaefe796d65d11c30266ef0 /spec
parentf8f96994f7aa53b1588762266bf60418960cf30d (diff)
parentc26816f7a732b339b14d7d6d928f5a86f490d77c (diff)
downloadgitlab-ce-b4faa59728c07893fe0f6d83648bf4d76e36320a.tar.gz
Merge branch 'issue_3749' into 'master'
Update Issues/MRs updated_at field when notes are generated Closes #3749 and #9130 See merge request !2493
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/note_data_builder_spec.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/lib/gitlab/note_data_builder_spec.rb b/spec/lib/gitlab/note_data_builder_spec.rb
index 6cbdae737f4..691f36e6cb7 100644
--- a/spec/lib/gitlab/note_data_builder_spec.rb
+++ b/spec/lib/gitlab/note_data_builder_spec.rb
@@ -37,7 +37,8 @@ describe 'Gitlab::NoteDataBuilder', lib: true do
it 'returns the note and issue-specific data' do
expect(data).to have_key(:issue)
- expect(data[:issue]).to eq(issue.hook_attrs)
+ expect(data[:issue].except('updated_at')).to eq(issue.hook_attrs.except('updated_at'))
+ expect(data[:issue]['updated_at']).to be > issue.hook_attrs['updated_at']
end
end
@@ -47,7 +48,8 @@ describe 'Gitlab::NoteDataBuilder', lib: true do
it 'returns the note and merge request data' do
expect(data).to have_key(:merge_request)
- expect(data[:merge_request]).to eq(merge_request.hook_attrs)
+ expect(data[:merge_request].except('updated_at')).to eq(merge_request.hook_attrs.except('updated_at'))
+ expect(data[:merge_request]['updated_at']).to be > merge_request.hook_attrs['updated_at']
end
end
@@ -57,7 +59,8 @@ describe 'Gitlab::NoteDataBuilder', lib: true do
it 'returns the note and merge request diff data' do
expect(data).to have_key(:merge_request)
- expect(data[:merge_request]).to eq(merge_request.hook_attrs)
+ expect(data[:merge_request].except('updated_at')).to eq(merge_request.hook_attrs.except('updated_at'))
+ expect(data[:merge_request]['updated_at']).to be > merge_request.hook_attrs['updated_at']
end
end
@@ -67,7 +70,8 @@ describe 'Gitlab::NoteDataBuilder', lib: true do
it 'returns the note and project snippet data' do
expect(data).to have_key(:snippet)
- expect(data[:snippet]).to eq(snippet.hook_attrs)
+ expect(data[:snippet].except('updated_at')).to eq(snippet.hook_attrs.except('updated_at'))
+ expect(data[:snippet]['updated_at']).to be > snippet.hook_attrs['updated_at']
end
end
end