Welcome to mirror list, hosted at ThFree Co, Russian Federation.

build_primary_xml_service_spec.rb « repository_metadata « rpm « packages « services « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 902844c196a9fe5ca202f301063b8a416805c2f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true
require 'spec_helper'

RSpec.describe Packages::Rpm::RepositoryMetadata::BuildPrimaryXmlService do
  describe '#execute' do
    subject { described_class.new(data).execute }

    context 'when updating existing xml' do
      include_context 'with rpm package data'

      let(:data) { xml_update_params }
      let(:required_text_only_attributes) { %i[description summary arch name] }

      it 'adds node with required_text_only_attributes' do
        result = subject

        required_text_only_attributes.each do |attribute|
          expect(
            result.at("//package/#{attribute}").text
          ).to eq(data[attribute])
        end
      end
    end
  end
end