Welcome to mirror list, hosted at ThFree Co, Russian Federation.

metrics_dashboard_template_spec.rb « template « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4c2b3dea6001a91d90c4ddb8714fd1b350f74df9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Template::MetricsDashboardTemplate do
  subject { described_class }

  describe '.all' do
    it 'combines the globals and rest' do
      all = subject.all.map(&:name)

      expect(all).to include('Default')
    end
  end

  describe '#content' do
    it 'loads the full file' do
      example_dashboard = subject.new(Rails.root.join('lib/gitlab/metrics/templates/Default.metrics-dashboard.yml'))

      expect(example_dashboard.name).to eq 'Default'
      expect(example_dashboard.content).to start_with('#')
    end
  end

  it_behaves_like 'file template shared examples', 'Default', '.metrics-dashboard.yml'
end