diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-05 21:10:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-05 21:10:25 +0300 |
commit | f368b4968e55b32dcedfaefe7c31f7a9463454cf (patch) | |
tree | b3e4652bd0131adf46f4b7e07346a0dbfa32da05 /spec/serializers/environment_entity_spec.rb | |
parent | 2c2b5aeac04350b0d3e13d4b52add0b520bf2ebb (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 | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/serializers/environment_entity_spec.rb b/spec/serializers/environment_entity_spec.rb index 5b83507b4ec..a6101f825e9 100644 --- a/spec/serializers/environment_entity_spec.rb +++ b/spec/serializers/environment_entity_spec.rb @@ -3,9 +3,10 @@ require 'spec_helper' RSpec.describe EnvironmentEntity do + include KubernetesHelpers include Gitlab::Routing.url_helpers - let(:request) { double('request') } + let(:request) { double('request', current_user: user, project: project) } let(:entity) do described_class.new(environment, request: request) end @@ -167,4 +168,23 @@ RSpec.describe EnvironmentEntity do end end end + + context 'with deployment service ready' do + before do + allow(environment).to receive(:has_terminals?).and_return(true) + allow(environment).to receive(:rollout_status).and_return(kube_deployment_rollout_status) + end + + it 'exposes rollout_status' do + expect(subject).to include(:rollout_status) + end + end + + context 'with deployment service not ready' do + let(:user) { create(:user) } + + it 'does not expose rollout_status' do + expect(subject).not_to include(:rollout_status) + end + end end |