Sha256: 77bfd73dd197443b48a1925ca9c029a845073165b13d97a4515834f13b0cd0e7

Contents?: true

Size: 1.29 KB

Versions: 35

Compression:

Stored size: 1.29 KB

Contents

FactoryGirl.define do
  factory :mdm_web_vuln, :class => Mdm::WebVuln do
    #
    # Associations
    #
    association :web_site, :factory => :mdm_web_site

    #
    # Attributes
    #

    category { generate :mdm_web_vuln_category }
    confidence { generate :mdm_web_vuln_confidence }
    method { generate :mdm_web_vuln_method }
    name { generate :mdm_web_vuln_name }
    path { generate :mdm_web_vuln_path }
    params { generate :mdm_web_vuln_params }
    pname { params.first.first }
    proof { generate :mdm_web_vuln_proof }
    risk { generate :mdm_web_vuln_risk }
  end

  sequence :mdm_web_vuln_category do |n|
    "mdm_web_vuln_category_#{n}"
  end

  sequence :mdm_web_vuln_confidence do |n|
    # range is from 0 to 100
    n % 101
  end

  method_count = Mdm::WebVuln::METHODS.length

  sequence :mdm_web_vuln_method do |n|
    Mdm::WebVuln::METHODS[n % method_count]
  end

  sequence :mdm_web_vuln_name do |n|
    "Web Vulnerability #{n}"
  end

  sequence :mdm_web_vuln_path do |n|
    "path/to/vulnerability/#{n}"
  end

  sequence :mdm_web_vuln_params do |n|
    [
        [
            "param#{n}",
            "value#{n}"
        ]
    ]
  end

  sequence :mdm_web_vuln_proof do |n|
    "Mdm::WebVuln Proof #{n}"
  end

  sequence :mdm_web_vuln_risk do |n|
    # range is 0 .. 5
    n % 6

  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
metasploit_data_models-0.16.6-java spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.16.6 spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.16.5-java spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.16.5 spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.16.4-java spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.16.4 spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.16.3-java spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.16.1-java spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.16.1 spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.16.0-java spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.16.0 spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.15.2-java spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.15.2 spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.15.1-java spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.15.1 spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.15.0 spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.14.4-java spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.14.4 spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.14.3-java spec/factories/mdm/web_vulns.rb
metasploit_data_models-0.14.3 spec/factories/mdm/web_vulns.rb