summaryrefslogtreecommitdiff
path: root/spec/helpers/graph_helper_spec.rb
blob: 4acf38771b7ab8b799c003efc27778aac7f17221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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