diff options
Diffstat (limited to 'spec/presenters/packages/nuget/service_index_presenter_spec.rb')
-rw-r--r-- | spec/presenters/packages/nuget/service_index_presenter_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/presenters/packages/nuget/service_index_presenter_spec.rb b/spec/presenters/packages/nuget/service_index_presenter_spec.rb new file mode 100644 index 00000000000..19ef890e19f --- /dev/null +++ b/spec/presenters/packages/nuget/service_index_presenter_spec.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe ::Packages::Nuget::ServiceIndexPresenter do + let_it_be(:project) { create(:project) } + let_it_be(:presenter) { described_class.new(project) } + + describe '#version' do + subject { presenter.version } + + it { is_expected.to eq '3.0.0' } + end + + describe '#resources' do + subject { presenter.resources } + + it 'has valid resources' do + expect(subject.size).to eq 8 + subject.each do |resource| + %i[@id @type comment].each do |field| + expect(resource).to have_key(field) + expect(resource[field]).to be_a(String) + end + end + end + end +end |