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

observability_helper_spec.rb « projects « helpers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 65b6ddf04ec31841f50663766083ad53d5819617 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'
require 'json'

RSpec.describe Projects::ObservabilityHelper, type: :helper, feature_category: :tracing do
  describe '#observability_tracing_view_model' do
    let_it_be(:group) { build_stubbed(:group) }
    let_it_be(:project) { build_stubbed(:project, group: group) }

    it 'generates the correct JSON' do
      expected_json = {
        tracingUrl: Gitlab::Observability.tracing_url(project),
        provisioningUrl: Gitlab::Observability.provisioning_url(project),
        oauthUrl: Gitlab::Observability.oauth_url
      }.to_json

      expect(helper.observability_tracing_view_model(project)).to eq(expected_json)
    end
  end
end