Sha256: 94228fae4714246ba6391c4c4c9b28f6705dd00a392a3e2757c86056267086f8

Contents?: true

Size: 1.35 KB

Versions: 32

Compression:

Stored size: 1.35 KB

Contents

FactoryBot.define do
  factory :mdm_web_page, :aliases => [:web_page], :class => Mdm::WebPage do
    auth { generate :mdm_web_page_auth }
    body { generate :mdm_web_page_body }
    code { generate :mdm_web_page_code }
    cookie { generate :mdm_web_page_cookie }
    ctype { generate :mdm_web_page_ctype }
    headers { generate :mdm_web_page_headers }
    location { generate :mdm_web_page_location }
    mtime { generate :mdm_web_page_mtime }
    query { generate :mdm_web_page_query }

    #
    # Associations
    #
    association :web_site, :factory => :mdm_web_site
  end

  sequence :mdm_web_page_auth do |n|
    "Authorization: #{n}"
  end

  sequence :mdm_web_page_body do |n|
    xml = Builder::XmlMarkup.new(:indent => 2)

    xml.html

    xml.target!.strip
  end

  sequence :mdm_web_page_code do |n|
    n
  end

  sequence :mdm_web_page_cookie do |n|
    "name#{n}=value#{n}"
  end

  sequence :mdm_web_page_ctype do |n|
    "application/x-#{n}"
  end

  sequence :mdm_web_page_headers do |n|
    [
        [
            "Header#{n}",
            "Value#{n}"
        ]
    ]
  end

  sequence :mdm_web_page_location do |n|
    "http://example.com/location/#{n}"
  end

  sequence :mdm_web_page_mtime do |n|
    past = Time.now - n
    past.utc.strftime('%a, %d %b %Y %H:%M:%S %Z')
  end

  sequence :mdm_web_page_query do |n|
    "param#{n}=value#{n}"
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
wg-metasploit_data_models-4.1.4.02 spec/factories/mdm/web_pages.rb
metasploit_data_models-6.0.5 spec/factories/mdm/web_pages.rb
metasploit_data_models-6.0.4 spec/factories/mdm/web_pages.rb
metasploit_data_models-6.0.3 spec/factories/mdm/web_pages.rb
metasploit_data_models-6.0.2 spec/factories/mdm/web_pages.rb
metasploit_data_models-6.0.1 spec/factories/mdm/web_pages.rb
metasploit_data_models-6.0.0 spec/factories/mdm/web_pages.rb
metasploit_data_models-5.0.6 spec/factories/mdm/web_pages.rb
metasploit_data_models-5.0.5 spec/factories/mdm/web_pages.rb
metasploit_data_models-5.0.4 spec/factories/mdm/web_pages.rb
metasploit_data_models-5.0.3 spec/factories/mdm/web_pages.rb
metasploit_data_models-5.0.2 spec/factories/mdm/web_pages.rb
metasploit_data_models-5.0.1 spec/factories/mdm/web_pages.rb
metasploit_data_models-5.0.0 spec/factories/mdm/web_pages.rb
metasploit_data_models-4.1.4 spec/factories/mdm/web_pages.rb
metasploit_data_models-4.1.3 spec/factories/mdm/web_pages.rb
metasploit_data_models-4.1.2 spec/factories/mdm/web_pages.rb
metasploit_data_models-4.1.1 spec/factories/mdm/web_pages.rb
metasploit_data_models-4.1.0 spec/factories/mdm/web_pages.rb
metasploit_data_models-4.0.2 spec/factories/mdm/web_pages.rb