debian-mirror-gitlab/spec/requests/api/graphql/packages/nuget_spec.rb

30 lines
791 B
Ruby
Raw Normal View History

2021-06-08 01:23:25 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'nuget package details' do
include GraphqlHelpers
2021-09-04 01:27:46 +05:30
include_context 'package details setup'
2021-06-08 01:23:25 +05:30
2021-09-04 01:27:46 +05:30
let_it_be(:package) { create(:nuget_package, :with_metadatum, project: project) }
2021-06-08 01:23:25 +05:30
let(:metadata) { query_graphql_fragment('NugetMetadata') }
subject { post_graphql(query, current_user: user) }
before do
subject
end
2021-09-04 01:27:46 +05:30
it_behaves_like 'a package detail'
it_behaves_like 'a package with files'
2021-06-08 01:23:25 +05:30
it 'has the correct metadata' do
expect(metadata_response).to include(
2021-09-04 01:27:46 +05:30
'id' => global_id_of(package.nuget_metadatum),
'licenseUrl' => package.nuget_metadatum.license_url,
'projectUrl' => package.nuget_metadatum.project_url,
'iconUrl' => package.nuget_metadatum.icon_url
2021-06-08 01:23:25 +05:30
)
end
end