Sha256: 541fa0e67bdc09220e0ee3c2a478f455eabd5e9b0f1f99533eab50b947679e5d

Contents?: true

Size: 1.07 KB

Versions: 9

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'
require 'ostruct'

module Dradis::Plugins
  describe 'Qualys upload plugin' do
    before(:each) do
      # Stub template service
      templates_dir = File.expand_path('../../../../templates', __FILE__)
      expect_any_instance_of(Dradis::Plugins::TemplateService)
      .to receive(:default_templates_dir).and_return(templates_dir)

      stub_content_service

      @importer = Dradis::Plugins::Qualys::WAS::Importer.new(
        content_service: @content_service
      )
    end

    let(:example_xml) { 'spec/fixtures/files/simple_was.xml' }
    let(:run_import!) { @importer.import(file: example_xml) }

    it 'creates nodes as needed' do
      expect_to_create_node_with(label: 'example.com')
      run_import!
    end

    it 'creates issues as needed' do
      expect_to_create_issue_with(text: 'DNS Host Name')
      run_import!
    end

    it 'creates evidence as needed' do
      expect_to_create_evidence_with(
        content: 'http://example.com',
        issue: 'DNS Host Name',
        node_label: 'example.com'
      )
      run_import!
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dradis-qualys-4.10.0 spec/qualys/was/importer_spec.rb
dradis-qualys-4.9.0 spec/qualys/was/importer_spec.rb
dradis-qualys-4.8.0 spec/qualys/was/importer_spec.rb
dradis-qualys-4.7.0 spec/qualys/was/importer_spec.rb
dradis-qualys-4.6.0 spec/qualys/was/importer_spec.rb
dradis-qualys-4.5.0 spec/qualys/was/importer_spec.rb
dradis-qualys-4.4.0 spec/qualys/was/importer_spec.rb
dradis-qualys-4.3.0 spec/qualys/was/importer_spec.rb
dradis-qualys-4.2.0 spec/qualys/was/importer_spec.rb