2019-09-30 08:06:01 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-09-23 11:21:51 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 05:08:32 -04:00
|
|
|
RSpec.describe GraphHelper do
|
2015-09-23 11:21:51 -04:00
|
|
|
describe '#get_refs' do
|
2017-01-25 17:10:32 -05:00
|
|
|
let(:project) { create(:project, :repository) }
|
2015-09-23 11:21:51 -04:00
|
|
|
let(:commit) { project.commit("master") }
|
|
|
|
let(:graph) { Network::Graph.new(project, 'master', commit, '') }
|
|
|
|
|
2016-07-25 14:16:19 -04:00
|
|
|
it 'filters our refs used by GitLab' do
|
2015-09-23 11:21:51 -04:00
|
|
|
self.instance_variable_set(:@graph, graph)
|
2018-01-31 05:03:13 -05:00
|
|
|
refs = refs(project.repository, commit)
|
|
|
|
|
|
|
|
expect(refs).to match('master')
|
2015-09-23 11:21:51 -04:00
|
|
|
end
|
|
|
|
end
|
2021-01-12 10:10:37 -05:00
|
|
|
|
2021-04-19 05:09:30 -04:00
|
|
|
describe '#should_render_dora_charts' do
|
2021-01-12 10:10:37 -05:00
|
|
|
let(:project) { create(:project, :private) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
self.instance_variable_set(:@project, project)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'always returns false' do
|
2021-04-19 05:09:30 -04:00
|
|
|
expect(should_render_dora_charts).to be(false)
|
2021-04-14 20:09:12 -04:00
|
|
|
end
|
|
|
|
end
|
2015-09-23 11:21:51 -04:00
|
|
|
end
|