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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/ci/reports/security/evidence.rb')
-rw-r--r--spec/factories/ci/reports/security/evidence.rb60
1 files changed, 60 insertions, 0 deletions
diff --git a/spec/factories/ci/reports/security/evidence.rb b/spec/factories/ci/reports/security/evidence.rb
new file mode 100644
index 00000000000..ed744644447
--- /dev/null
+++ b/spec/factories/ci/reports/security/evidence.rb
@@ -0,0 +1,60 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :ci_reports_security_evidence, class: '::Gitlab::Ci::Reports::Security::Evidence' do
+ data do
+ {
+ summary: 'Credit card detected',
+ request: {
+ headers: [{ name: 'Accept', value: '*/*' }],
+ method: 'GET',
+ url: 'http://goat:8080/WebGoat/logout',
+ body: nil
+ },
+ response: {
+ headers: [{ name: 'Content-Length', value: '0' }],
+ reason_phrase: 'OK',
+ status_code: 200,
+ body: nil
+ },
+ source: {
+ id: 'assert:Response Body Analysis',
+ name: 'Response Body Analysis',
+ url: 'htpp://hostname/documentation'
+ },
+ supporting_messages: [
+ {
+ name: 'Origional',
+ request: {
+ headers: [{ name: 'Accept', value: '*/*' }],
+ method: 'GET',
+ url: 'http://goat:8080/WebGoat/logout',
+ body: ''
+ }
+ },
+ {
+ name: 'Recorded',
+ request: {
+ headers: [{ name: 'Accept', value: '*/*' }],
+ method: 'GET',
+ url: 'http://goat:8080/WebGoat/logout',
+ body: ''
+ },
+ response: {
+ headers: [{ name: 'Content-Length', value: '0' }],
+ reason_phrase: 'OK',
+ status_code: 200,
+ body: ''
+ }
+ }
+ ]
+ }
+ end
+
+ skip_create
+
+ initialize_with do
+ ::Gitlab::Ci::Reports::Security::Evidence.new(**attributes)
+ end
+ end
+end