Sha256: d5647dd0e53b7fda899eb1a130047ef46c599c7ee44560295286420ff1757161

Contents?: true

Size: 1.35 KB

Versions: 120

Compression:

Stored size: 1.35 KB

Contents

FactoryGirl.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

120 entries across 120 versions & 1 rubygems

Version Path
metasploit_data_models-2.0.17 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.16 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.15 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.14 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.13 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.12 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.11 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.10 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.9 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.8 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.7 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.6 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.5 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.4 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.1 spec/factories/mdm/web_pages.rb
metasploit_data_models-2.0.0 spec/factories/mdm/web_pages.rb
metasploit_data_models-1.3.0 spec/factories/mdm/web_pages.rb
metasploit_data_models-1.2.11 spec/factories/mdm/web_pages.rb
metasploit_data_models-1.2.10 spec/factories/mdm/web_pages.rb
metasploit_data_models-1.2.9 spec/factories/mdm/web_pages.rb