diff options
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 %( |