gitlab-org--gitlab-foss/spec/models/network/graph_spec.rb
Stan Hu 5cb488e8a1 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
2016-08-20 09:57:20 -07:00

12 lines
366 B
Ruby

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