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

flag_spec.rb « security « reports « ci « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6ee074f7aeb14f33fd3c18e5c78d32a4ceba1cdc (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
26
27
28
29
30
31
32
33
# frozen_string_literal: true

require 'fast_spec_helper'

RSpec.describe Gitlab::Ci::Reports::Security::Flag do
  subject(:security_flag) { described_class.new(type: 'flagged-as-likely-false-positive', origin: 'post analyzer X', description: 'static string to sink') }

  describe '#initialize' do
    context 'when all params are given' do
      it 'initializes an instance' do
        expect { subject }.not_to raise_error

        expect(subject).to have_attributes(
          type: 'flagged-as-likely-false-positive',
          origin: 'post analyzer X',
          description: 'static string to sink'
        )
      end
    end

    describe '#to_h' do
      it 'returns expected hash' do
        expect(security_flag.to_h).to eq(
          {
            flag_type: :false_positive,
            origin: 'post analyzer X',
            description: 'static string to sink'
          }
        )
      end
    end
  end
end