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>2015-09-23 18:21:51 +0300
committerStan Hu <stanhu@gmail.com>2015-09-23 18:56:32 +0300
commit150fb81ef90cba74bf7828e652e052b9ababcdf8 (patch)
treec11fd94cfcb68fa7ad209822ee6e6d13a694b7ed /spec/helpers/graph_helper_spec.rb
parent03fd5919a393b8784c601c76c3ed65912f4b522a (diff)
Remove git refs used internally by GitLab from network graph
Closes #2702
Diffstat (limited to 'spec/helpers/graph_helper_spec.rb')
-rw-r--r--spec/helpers/graph_helper_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/helpers/graph_helper_spec.rb b/spec/helpers/graph_helper_spec.rb
new file mode 100644
index 00000000000..4acf38771b7
--- /dev/null
+++ b/spec/helpers/graph_helper_spec.rb
@@ -0,0 +1,16 @@
+require 'spec_helper'
+
+describe GraphHelper do
+ describe '#get_refs' do
+ let(:project) { create(:project) }
+ let(:commit) { project.commit("master") }
+ let(:graph) { Network::Graph.new(project, 'master', commit, '') }
+
+ it 'filter our refs used by GitLab' do
+ allow(commit).to receive(:ref_names).and_return(['refs/merge-requests/abc', 'master', 'refs/tmp/xyz'])
+ self.instance_variable_set(:@graph, graph)
+ refs = get_refs(project.repository, commit)
+ expect(refs).to eq('master')
+ end
+ end
+end