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:
authorStan Hu <stanhu@gmail.com>2016-08-20 19:18:06 +0300
committerStan Hu <stanhu@gmail.com>2016-08-20 19:57:20 +0300
commit5cb488e8a1a10432c1c5a322b2d4748cb754277f (patch)
tree9f5a1e13e445d4d25af680eaea80fc16a67a73ce /spec/models/network
parent6a05f24621646790d1f5bccd0abc003b5386d0f0 (diff)
Fix Error 500 resulting when loading network graph
`discussion_id` may not be present when the SELECT call for notes does not include this attribute. Don't attempt to set the discussion ID unless the model contains the attribute. Closes #21119, #21128
Diffstat (limited to 'spec/models/network')
-rw-r--r--spec/models/network/graph_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/network/graph_spec.rb b/spec/models/network/graph_spec.rb
new file mode 100644
index 00000000000..b76513d2a3c
--- /dev/null
+++ b/spec/models/network/graph_spec.rb
@@ -0,0 +1,12 @@
+require 'spec_helper'
+
+describe Network::Graph, models: true do
+ let(:project) { create(:project) }
+ let!(:note_on_commit) { create(:note_on_commit, project: project) }
+
+ it '#initialize' do
+ graph = described_class.new(project, 'refs/heads/master', project.repository.commit, nil)
+
+ expect(graph.notes).to eq( { note_on_commit.commit_id => 1 } )
+ end
+end