2019-12-21 20:55:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-09-25 12:07:36 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe GraphHelper do
|
2015-09-25 12:07:36 +05:30
|
|
|
describe '#get_refs' do
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:project) { create(:project, :repository) }
|
2015-09-25 12:07:36 +05:30
|
|
|
let(:commit) { project.commit("master") }
|
|
|
|
let(:graph) { Network::Graph.new(project, 'master', commit, '') }
|
|
|
|
|
2016-09-13 17:45:13 +05:30
|
|
|
it 'filters our refs used by GitLab' do
|
2015-09-25 12:07:36 +05:30
|
|
|
self.instance_variable_set(:@graph, graph)
|
2018-03-17 18:26:18 +05:30
|
|
|
refs = refs(project.repository, commit)
|
|
|
|
|
|
|
|
expect(refs).to match('master')
|
2015-09-25 12:07:36 +05:30
|
|
|
end
|
|
|
|
end
|
2021-03-08 18:12:59 +05:30
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
describe '#should_render_dora_charts' do
|
2021-03-08 18:12:59 +05:30
|
|
|
let(:project) { create(:project, :private) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
self.instance_variable_set(:@project, project)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'always returns false' do
|
2021-04-29 21:17:54 +05:30
|
|
|
expect(should_render_dora_charts).to be(false)
|
2021-03-08 18:12:59 +05:30
|
|
|
end
|
|
|
|
end
|
2015-09-25 12:07:36 +05:30
|
|
|
end
|