diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/graphql/types/environment_type_spec.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/graphql/types/environment_type_spec.rb')
-rw-r--r-- | spec/graphql/types/environment_type_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/graphql/types/environment_type_spec.rb b/spec/graphql/types/environment_type_spec.rb index 3671d35e8a5..ae58fe00af7 100644 --- a/spec/graphql/types/environment_type_spec.rb +++ b/spec/graphql/types/environment_type_spec.rb @@ -7,7 +7,8 @@ RSpec.describe GitlabSchema.types['Environment'] do it 'has the expected fields' do expected_fields = %w[ - name id state metrics_dashboard latest_opened_most_severe_alert path + name id state metrics_dashboard latest_opened_most_severe_alert path external_url deployments + slug createdAt updatedAt autoStopAt autoDeleteAt tier environmentType lastDeployment ] expect(described_class).to have_graphql_fields(*expected_fields) @@ -17,7 +18,7 @@ RSpec.describe GitlabSchema.types['Environment'] do context 'when there is an environment' do let_it_be(:project) { create(:project) } - let_it_be(:environment) { create(:environment, project: project) } + let_it_be(:environment) { create(:environment, project: project, external_url: 'https://gitlab.com') } let_it_be(:user) { create(:user) } subject { GitlabSchema.execute(query, context: { current_user: user }).as_json } @@ -29,6 +30,7 @@ RSpec.describe GitlabSchema.types['Environment'] do environment(name: "#{environment.name}") { name path + externalUrl state } } @@ -50,6 +52,10 @@ RSpec.describe GitlabSchema.types['Environment'] do ) end + it 'returns the external url of the environment' do + expect(subject['data']['project']['environment']['externalUrl']).to eq(environment.external_url) + end + context 'when query alert data for the environment' do let_it_be(:query) do %( |