Sha256: 308701a2bfaa6ce6bf2d1acf5b11fe14d13422c37324b8f459be2035303e39e9

Contents?: true

Size: 1015 Bytes

Versions: 28

Compression:

Stored size: 1015 Bytes

Contents

require 'spec_helper'

describe Dradis::Plugins::Saint::Importer 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)

    plugin = Dradis::Plugins::Saint

    @content_service = Dradis::Plugins::ContentService::Base.new(
      logger: Logger.new(STDOUT),
      plugin: plugin
    )

    @importer = described_class.new(
      content_service: @content_service
    )
  end

  it "creates the appropriate Dradis items" do
    allow(@content_service).to receive(:create_issue) do |args|
      OpenStruct.new(args)
    end
    allow(@content_service).to receive(:create_note) do |args|
      OpenStruct.new(args)
    end
    expect(@content_service).to receive(:create_node).with(hash_including label: '192.168.150.163').once

    @importer.import(file: 'spec/fixtures/files/saint_metasploitable_sample.xml')
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

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