Sha256: 5d2d0331cece0f63e429cd4fb2ef2ef86fcf817ae3a2a6e94b3a074301f47619

Contents?: true

Size: 1.22 KB

Versions: 22

Compression:

Stored size: 1.22 KB

Contents

require 'spec_helper'
require 'ostruct'

describe Dradis::Plugins::Nessus::FieldProcessor do

  describe '%report_item.description% field formatting' do
    context 'bullet points' do
      before do
        doc = Nokogiri::XML(
          File.read('spec/fixtures/files/report_item-with-list.xml')
        )
        processor = described_class.new(data: doc.root)

        @value = processor.value(field: 'report_item.description')
      end

      it 'converts Nessus broken lists into Textile bullet-point lists' do
        expect(@value).to_not be_empty

        expect(@value).to include(
          '* A denial of service vulnerability exists relating to '\
          'the \'mod_dav\' module as it relates to MERGE requests.'
        )
      end

      it 'does not add unnecessary newlines to list items' do
        expect(@value).to include("vulnerabilities:\n\n* A flaw exists")
      end
    end
  end

  it 'Recasted severity values appear in the Evidence' do
    doc = Nokogiri::XML(
      File.read('spec/fixtures/files/report_item-with-list.xml')
    )
    processor = described_class.new(data: doc.root)
    value = processor.value(field: 'evidence.severity')
    expect(value).to_not be_empty
    expect(value).to include('2')
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
dradis-nessus-4.14.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.13.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.11.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.10.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.9.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.8.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.7.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.6.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.5.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.4.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.3.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.2.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.1.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-4.0.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-3.22.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-3.21.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-3.20.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-3.19.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-3.18.0 spec/dradis/plugins/nessus/field_processor_spec.rb
dradis-nessus-3.17.0 spec/dradis/plugins/nessus/field_processor_spec.rb