<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -26,12 +26,14 @@ module Trample
     end
 
     def login
+      pages_before = @pages.size
       if block_given?
         yield
-        @login = pages.pop
+        pages_added = @pages.size - pages_before
+        @login = pages.slice! pages_before, pages_added
       end
 
-      @login
+      @login ||= []
     end
 
     def ==(other)</diff>
      <filename>lib/trample/configuration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,7 @@ module Trample
     end
 
     def trample
-      hit @config.login unless @config.login.nil?
+      @config.login.each {|page| hit page} unless @config.login.empty?
       @config.iterations.times do
         @config.pages.each do |p|
           hit p</diff>
      <filename>lib/trample/session.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,6 +13,7 @@ class ConfigurationTest &lt; Test::Unit::TestCase
         post &quot;http://google.com/&quot;, {:q =&gt; &quot;something&quot;}
         post &quot;http://google.com/&quot;, &amp;@params_proc
         login do
+          get &quot;http://google.com&quot;
           post &quot;http://google.com/login&quot; do
             { :q =&gt; &quot;whatever&quot; }
           end
@@ -46,9 +47,12 @@ class ConfigurationTest &lt; Test::Unit::TestCase
       assert_equal expected, @config.pages[2]
     end
 
+    should &quot;support a login parameter which contains pages to hit for authentication&quot; do
+      assert_equal [&quot;http://google.com&quot;, &quot;http://google.com/login&quot;], @config.login.map{|page| page.url}
+    end
+
     should &quot;support a login parameter which contains a page to hit with params&quot; do
-      assert_equal &quot;http://google.com/login&quot;, @config.login.url
-      assert_equal({:q =&gt; &quot;whatever&quot;}, @config.login.parameters)
+      assert_equal({:q =&gt; &quot;whatever&quot;}, @config.login.last.parameters)
     end
 
     should &quot;be equal if all the objects are the same&quot; do</diff>
      <filename>test/configuration_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3ee9a8f07dc5ef26dc5adc66c6aea7b22a8f6194</id>
    </parent>
  </parents>
  <author>
    <name>Wes Gibbs</name>
    <email>wes@hashrocket.com</email>
  </author>
  <url>http://github.com/wgibbs/trample/commit/ce0ea9f15dac042df3a10352bfeeb7e6f805c48a</url>
  <id>ce0ea9f15dac042df3a10352bfeeb7e6f805c48a</id>
  <committed-date>2009-10-03T11:46:56-07:00</committed-date>
  <authored-date>2009-10-03T11:46:56-07:00</authored-date>
  <message>login supports multiple page requests

Simulating a login on many apps may require more than a single POST. For
instance, a GET might be required first to return a login form
containing a hidden authenticity token that must be returned in the POST
parameters for login to succeed.</message>
  <tree>ef5580cc34dae8111e81e328aa2755e90ba18a9f</tree>
  <committer>
    <name>Wes Gibbs</name>
    <email>wes@hashrocket.com</email>
  </committer>
</commit>
