Sha256: 87910d1385ec8ce6f3eed68c1ce4ab53c9c98bbc7c569134f34f60594ec04e5f

Contents?: true

Size: 1.54 KB

Versions: 2

Compression:

Stored size: 1.54 KB

Contents

# 4f61ac3d5607139350b50335ca59a34d04b34ec7

desc "Business Finder Testplan"

usecase 65, "Simple search" do
  resource :search_terms, list('search_terms.csv')
  
  get "/", "Homepage" do
    wait 1..5
    response 200 do
      status                       # => 200
      headers['Content-Type']      # => ['text/html']
      body                         # => <html>...
      doc                          # => Nokigiri::HTML::Document
    end
  end
  
  get "/search", "Search Results" do
    wait 2..5
    param :what  => random(:search_terms)
    param :where => random(['Toronto', 'Montreal'])
    response 200 do
      listing = doc.css('div.listing').first
      set :lid, listing['id'].match(/(\d+)/)[0]
    end
  end
  
  get "/listing/:lid" do           # URIs can contain variables.
    desc "Selected listing"        # This one will be replaced by
    wait 1..8                      # the one stored in the previous
  end                              # request.
  
end

usecase 10, "Self-serve" do
  post "/listing/add", "Add a listing" do
    wait 1..4 
    param :name => random(8)
    param :city => "Vancouver"
    response 302 do
      repeat 3
    end
  end
end

usecase "Listing API" do
  
  get '/listings.yaml', "View All" do
    response 200 do
      # doc contains the parsed YAML object
      listings = doc.collect! { |l|; l[:id]; }
      set :current_listing_ids, listings
    end
  end
  
  get "/listing/:lid.yaml", "Select (sequential)" do
    param :lid => rsequential(:current_listing_ids)
    response 200 do
      repeat 7
    end
  end
  
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
solutious-stella-0.7.0.004 examples/basic/plan.rb
stella-0.7.0.004 examples/basic/plan.rb