diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-11 18:09:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-11 18:09:37 +0300 |
commit | a210c43e0aca0311cc1d3d381763b25979ec72dc (patch) | |
tree | 0325d173da7a6e7bd6c2cdf450d0aa1c4e142d0f /spec/serializers/environment_entity_spec.rb | |
parent | c9687bdf58e9d4a9c3942f587bd4841f42e3b5de (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers/environment_entity_spec.rb')
-rw-r--r-- | spec/serializers/environment_entity_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/serializers/environment_entity_spec.rb b/spec/serializers/environment_entity_spec.rb index f392ecea959..b4ea90d2141 100644 --- a/spec/serializers/environment_entity_spec.rb +++ b/spec/serializers/environment_entity_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' describe EnvironmentEntity do + include Gitlab::Routing.url_helpers + let(:request) { double('request') } let(:entity) do described_class.new(environment, request: spy('request')) @@ -71,4 +73,22 @@ describe EnvironmentEntity do expect(subject).to include(:cancel_auto_stop_path, :auto_stop_at) end end + + context 'pod_logs' do + it 'exposes logs keys' do + expect(subject).to include(:logs_path) + expect(subject).to include(:logs_api_path) + expect(subject).to include(:enable_advanced_logs_querying) + end + + it 'uses k8s api when ES is not available' do + expect(subject[:logs_api_path]).to eq(k8s_project_logs_path(environment.project, environment_name: environment.name, format: :json)) + end + + it 'uses ES api when ES is available' do + allow(environment).to receive(:elastic_stack_available?).and_return(true) + + expect(subject[:logs_api_path]).to eq(elasticsearch_project_logs_path(environment.project, environment_name: environment.name, format: :json)) + end + end end |