diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-28 00:07:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-28 00:07:46 +0300 |
commit | d74abe41c00eedb95738a74b9bbdea67e423103b (patch) | |
tree | 754f93e47d205f0cb6908b6abb4cf7713bdef879 /spec/helpers | |
parent | 7dd130e2cae40514f02b02922251b62302f2fdd5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/projects/observability_helper_spec.rb | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/helpers/projects/observability_helper_spec.rb b/spec/helpers/projects/observability_helper_spec.rb index 65b6ddf04ec..0f47cdb8be2 100644 --- a/spec/helpers/projects/observability_helper_spec.rb +++ b/spec/helpers/projects/observability_helper_spec.rb @@ -4,10 +4,12 @@ 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) } + include Gitlab::Routing.url_helpers + + let_it_be(:group) { build_stubbed(:group) } + let_it_be(:project) { build_stubbed(:project, group: group) } + describe '#observability_tracing_view_model' do it 'generates the correct JSON' do expected_json = { tracingUrl: Gitlab::Observability.tracing_url(project), @@ -18,4 +20,18 @@ RSpec.describe Projects::ObservabilityHelper, type: :helper, feature_category: : expect(helper.observability_tracing_view_model(project)).to eq(expected_json) end end + + describe '#observability_tracing_details_model' do + it 'generates the correct JSON' do + expected_json = { + tracingIndexUrl: namespace_project_tracing_index_path(project.group, project), + traceId: "trace-id", + tracingUrl: Gitlab::Observability.tracing_url(project), + provisioningUrl: Gitlab::Observability.provisioning_url(project), + oauthUrl: Gitlab::Observability.oauth_url + }.to_json + + expect(helper.observability_tracing_details_model(project, "trace-id")).to eq(expected_json) + end + end end |