From f0fc939438b63e612acfe471b5708c6fc21bce8d Mon Sep 17 00:00:00 2001 From: Bernhard Suttner Date: Mon, 8 Apr 2024 18:55:08 +0200 Subject: [PATCH] Add test --- .../cve_report_scanner_test.rb | 16 ++++++++++++++++ test/unit/foreman_cve_scanner_test.rb | 11 ----------- 2 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 test/services/foreman_cve_scanner/cve_report_scanner_test.rb delete mode 100644 test/unit/foreman_cve_scanner_test.rb diff --git a/test/services/foreman_cve_scanner/cve_report_scanner_test.rb b/test/services/foreman_cve_scanner/cve_report_scanner_test.rb new file mode 100644 index 0000000..d90637b --- /dev/null +++ b/test/services/foreman_cve_scanner/cve_report_scanner_test.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module ForemanCveScanner + class CveReportScannerTest < ActiveSupport::TestCase + def setup + raw = { + 'reporter' => 'cve_scan' + } + @scanner = ForemanCveScanner::CveReportScanner.new(raw) + end + + test 'should identify as cve scan' do + assert_equasl @scanner.identify_origin, 'CveScanner' + end + end +end diff --git a/test/unit/foreman_cve_scanner_test.rb b/test/unit/foreman_cve_scanner_test.rb deleted file mode 100644 index b04e72c..0000000 --- a/test/unit/foreman_cve_scanner_test.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'test_plugin_helper' - -class ForemanPluginTemplateTest < ActiveSupport::TestCase - setup do - User.current = User.find_by login: 'admin' - end - - test 'the truth' do - assert true - end -end