diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-01-20 18:06:49 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-01-20 18:06:49 +0300 |
commit | b4faa59728c07893fe0f6d83648bf4d76e36320a (patch) | |
tree | 91ddc330527189518eaefe796d65d11c30266ef0 /spec | |
parent | f8f96994f7aa53b1588762266bf60418960cf30d (diff) | |
parent | c26816f7a732b339b14d7d6d928f5a86f490d77c (diff) |
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.rb | 12 |
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 |