Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-03-06 01:42:48 +0300
committerRobert Speicher <robert@gitlab.com>2018-03-06 01:42:48 +0300
commit4ac0a4bf1001941bfa47b0db6a2eedab1e98a36e (patch)
tree4f6723ac0ced02999f03f4bba41eb6cb1274f596 /spec/services/system_hooks_service_spec.rb
parent6ec655f5c46aab93f435ac9218c7354b0a712160 (diff)
parent2d1ceca077a1624a4bdc6aa26ab8a5113a5f6394 (diff)
Merge branch 'sh-fix-issue-43871-system-hooks' into 'master'
Don't error out in system hook if user has `nil` datetime columns Closes #43871 See merge request gitlab-org/gitlab-ce!17543
Diffstat (limited to 'spec/services/system_hooks_service_spec.rb')
-rw-r--r--spec/services/system_hooks_service_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/services/system_hooks_service_spec.rb b/spec/services/system_hooks_service_spec.rb
index 08b26597723..51396d34f8f 100644
--- a/spec/services/system_hooks_service_spec.rb
+++ b/spec/services/system_hooks_service_spec.rb
@@ -74,6 +74,14 @@ describe SystemHooksService do
expect(data[:project_visibility]).to eq('private')
end
+ it 'handles nil datetime columns' do
+ user.update_attributes(created_at: nil, updated_at: nil)
+ data = event_data(user, :destroy)
+
+ expect(data[:created_at]).to be(nil)
+ expect(data[:updated_at]).to be(nil)
+ end
+
context 'group_rename' do
it 'contains old and new path' do
allow(group).to receive(:path_was).and_return('old-path')