<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/webrat/core/save_and_open_page.rb</filename>
    </added>
    <added>
      <filename>spec/webrat/merb/merb_session_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -10,3 +10,4 @@ log
 .loadpath
 *.swp
 results
+test_apps
\ No newline at end of file</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -6,9 +6,13 @@
   * Removed auto-require of webrat/rails when requiring webrat when RAILS_ENV is
     defined
   
-  In your env.rb file, ensure you have:
+  In your env.rb or test_helper.rb file, ensure you have something like:
   
-    require &quot;webrat/rails&quot;
+    require &quot;webrat&quot;
+    
+    Webrat.configure do |config|
+      config.mode = :rails
+    end
   
 * Major enhancements
 
@@ -16,7 +20,10 @@
   * Use Hpricot and REXML when not parsing with Nokogiri (on JRuby, for example)
 
 * Minor enhancements
-  * Now sets the mode with configuration.mode in the block (Mike Gaffney, Ticket #85)
+  * Added assert_contain, assert_not_contain [#86] (Mike Gaffney)
+  * Maximize the browser window after initializing Selenium (Luke Melia)
+  * Better inspect output for Webrat elements
+  * Sets the Webrat mode with Configuration#mode= in the config block [#85] (Mike Gaffney)
   * Detect if the document is XML or HTML using the Content-Type when in Rails mode
   * Expose #selenium method for direct access to Selenium client
   * Check nokogiri gem version before requiring nokogiri
@@ -50,6 +57,8 @@
   * Raise Webrat::PageLoadError when a failure occurs so that application exceptions
     can be more accurately tested (Ryan Briones)
   * Helpful error message for missing option in select box. [#40] (Ben Mabey)
+  * Extracted save_and_open page to make it usable in Selenium mode (Luke Melia)
+  * Added save_and_open_screengrab for Selenium mode (Luke Melia)
 
 * Bug fixes
   
@@ -66,6 +75,13 @@
   * Extend Rails' ActionController::IntegrationTest instead of
     ActionController::Integration::Session (Fixes using Webrat's #select method and 
     avoids usage of method_missing)
+  * Ensure that Webrat::MechanizeSession.request_page always uses an absolute 
+    URL. (Graham Ashton)
+  * Strip anchor tags from URIs before passing to Rails integration session
+    (Noah Davis)
+  * Treat text and regexp when matching Selenium buttons (Ross Kaffenberger)
+  * Allow SeleniumSession's click_button to be called without an argument without
+    blowing up (Luke Melia)
     
 == 0.3.2 / 2008-11-08
 </diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -59,11 +59,12 @@ To install the latest code as a plugin: (_Note:_ This may be less stable than us
 
   script/plugin install git://github.com/brynary/webrat.git
 
-In your test_helper.rb, spec_helper.rb, or env.rb (for Cucumber) add:
+In your test_helper.rb or env.rb (for Cucumber) add:
 
   require &quot;webrat&quot;
+  
   Webrat.configure do |config|
-    config.mode = Webrat::Configuration::RAILS_MODE
+    config.mode = :rails
   end
   
 == Install with Merb</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ module Webrat
   class WebratError &lt; StandardError
   end
 
-  VERSION = '0.3.2.1'
+  VERSION = '0.3.2.2'
 
   def self.require_xml
     gem &quot;nokogiri&quot;, &quot;&gt;= 1.0.6&quot;</diff>
      <filename>lib/webrat.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,3 +11,4 @@ require &quot;webrat/core/elements/select_option&quot;
 require &quot;webrat/core/session&quot;
 require &quot;webrat/core/methods&quot;
 require &quot;webrat/core/matchers&quot;
+require &quot;webrat/core/save_and_open_page&quot;</diff>
      <filename>lib/webrat/core.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,6 +24,10 @@ module Webrat
       Webrat::XML.xpath_to(@element)
     end
     
+    def inspect
+      &quot;#&lt;#{self.class} @element=#{element.inspect}&gt;&quot;
+    end
+    
   end
   
 end
\ No newline at end of file</diff>
      <filename>lib/webrat/core/elements/element.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@ require &quot;forwardable&quot;
 require &quot;ostruct&quot;
 
 require &quot;webrat/core/mime&quot;
+require &quot;webrat/core/save_and_open_page&quot;
 
 module Webrat
   # A page load or form submission returned an unsuccessful response code (500-599)
@@ -30,6 +31,7 @@ module Webrat
   class Session
     extend Forwardable
     include Logging
+    include SaveAndOpenPage
     
     attr_reader :current_url
     attr_reader :elements
@@ -43,23 +45,6 @@ module Webrat
       
       reset
     end
-
-    # Saves the page out to RAILS_ROOT/tmp/ and opens it in the default
-    # web browser if on OS X. Useful for debugging.
-    # 
-    # Example:
-    #   save_and_open_page
-    def save_and_open_page
-      return unless File.exist?(saved_page_dir)
-
-      filename = &quot;#{saved_page_dir}/webrat-#{Time.now.to_i}.html&quot;
-      
-      File.open(filename, &quot;w&quot;) do |f|
-        f.write rewrite_css_and_image_references(response_body)
-      end
-
-      open_in_browser(filename)
-    end
     
     def current_dom #:nodoc:
       current_scope.dom
@@ -78,10 +63,6 @@ module Webrat
       nil
     end
     
-    def saved_page_dir #:nodoc:
-      File.expand_path(&quot;.&quot;)
-    end
-
     def header(key, value)
       @custom_headers[key] = value
     end
@@ -172,20 +153,6 @@ module Webrat
     end
     
     webrat_deprecate :visits, :visit
-    
-    def open_in_browser(path) # :nodoc
-      platform = ruby_platform
-      if platform =~ /cygwin/ || platform =~ /win32/
-        `rundll32 url.dll,FileProtocolHandler #{path.gsub(&quot;/&quot;, &quot;\\\\&quot;)}`
-      elsif platform =~ /darwin/
-        `open #{path}`
-      end
-    end
-    
-    def rewrite_css_and_image_references(response_html) # :nodoc:
-      return response_html unless doc_root
-      response_html.gsub(/&quot;\/(stylesheets|images)/, doc_root + '/\1')
-    end
 
     # Subclasses can override this to show error messages without html
     def formatted_error #:nodoc:
@@ -247,9 +214,5 @@ module Webrat
       @_page_scope  = nil
     end
     
-    # accessor for testing
-    def ruby_platform
-      RUBY_PLATFORM
-    end
   end
 end</diff>
      <filename>lib/webrat/core/session.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,10 @@ module Webrat #:nodoc:
     attr_accessor :response
     alias :page :response
     
+    def request_page(url, http_method, data) #:nodoc:
+      super(absolute_url(url), http_method, data)
+    end
+    
     def get(url, data, headers_argument_not_used = nil)
       @response = mechanize.get(url, data)
     end
@@ -36,6 +40,35 @@ module Webrat #:nodoc:
     end
 
     def_delegators :mechanize, :basic_auth
+    
+    def absolute_url(url) #:nodoc:
+      current_host, current_path = split_current_url
+      if url =~ Regexp.new('^https?://')
+        url
+      elsif url =~ Regexp.new('^/')
+        current_host + url
+      elsif url =~ Regexp.new('^\.')
+        current_host + absolute_path(current_path, url)
+      else
+        url
+      end
+    end
+    
+    private
+      def split_current_url
+        current_url =~ Regexp.new('^(https?://[^/]+)(/.*)?')
+        [Regexp.last_match(1), Regexp.last_match(2)]
+      end
       
+      def absolute_path(current_path, url)
+        levels_up = url.split('/').find_all { |x| x == '..' }.size
+        ancestor = if current_path.nil?
+          &quot;&quot;
+        else
+          current_path.split(&quot;/&quot;)[0..(-1 - levels_up)].join(&quot;/&quot;)
+        end
+        descendent = url.split(&quot;/&quot;)[levels_up..-1]
+        &quot;#{ancestor}/#{descendent}&quot;
+      end
   end
 end</diff>
      <filename>lib/webrat/mechanize.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,6 @@
 require &quot;webrat&quot;
+
+require &quot;action_controller&quot;
 require &quot;action_controller/integration&quot;
 
 module Webrat
@@ -48,15 +50,18 @@ module Webrat
     
     def do_request(http_method, url, data, headers) #:nodoc:
       update_protocol(url)
-      integration_session.request_via_redirect(http_method, remove_protocol(url), data, headers)
+      url = normalize_url(url)
+      integration_session.request_via_redirect(http_method, url, data, headers)
     end
   
-    def remove_protocol(href) #:nodoc:
-      if href =~ %r{^https?://www.example.com(/.*)}
-        $LAST_MATCH_INFO.captures.first
-      else
-        href
+    # remove protocol, host and anchor
+    def normalize_url(href) #:nodoc:
+      uri = URI.parse(href)
+      normalized_url = uri.path
+      if uri.query
+        normalized_url += &quot;?&quot; + uri.query
       end
+      normalized_url
     end
     
     def update_protocol(href) #:nodoc:</diff>
      <filename>lib/webrat/rails.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,14 +38,10 @@ module Webrat
   # To use Webrat's Selenium support, you'll need the selenium-client gem installed.
   # Activate it with (for example, in your &lt;tt&gt;env.rb&lt;/tt&gt;):
   #
-  #   require &quot;webrat/selenium&quot;
-  # 
-  # Then, if you're using Cucumber, configure it to use a 
-  # &lt;tt&gt;Webrat::Selenium::Rails::World&lt;/tt&gt; as the scenario context by adding
-  # the following to &lt;tt&gt;env.rb&lt;/tt&gt;:
-  #
-  #   World do
-  #     Webrat::Selenium::Rails::World.new
+  #   require &quot;webrat&quot;
+  #   
+  #   Webrat.configure do |config|
+  #     config.mode = :selenium
   #   end
   #
   # == Dropping down to the selenium-client API
@@ -72,31 +68,26 @@ module Webrat
   # your Webrat::Selenium tests ignoring the concurrency issues that can plague in-browser
   # testing, so long as you're using the Webrat API.
   module Selenium
-    
-    module Rails #:nodoc:
-      class World &lt; ::ActionController::IntegrationTest
-        include Webrat::Selenium::Matchers
-        
-        def initialize #:nodoc:
-          @_result = Test::Unit::TestResult.new
-        end
-        
-        def response
-          webrat_session.response
-        end
-        
-        def wait_for(*args, &amp;block)
-          webrat_session.wait_for(*args, &amp;block)
-        end
-        
+    module Methods
+      def response
+        webrat_session.response
+      end
+
+      def wait_for(*args, &amp;block)
+        webrat_session.wait_for(*args, &amp;block)
+      end
+
+      def save_and_open_screengrab
+        webrat_session.save_and_open_screengrab
       end
     end
   end
-    
 end
 
 module ActionController #:nodoc:
   IntegrationTest.class_eval do
     include Webrat::Methods
+    include Webrat::Selenium::Methods
+    include Webrat::Selenium::Matchers
   end
 end</diff>
      <filename>lib/webrat/selenium.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require &quot;webrat/core/save_and_open_page&quot;
+
 module Webrat
   class TimeoutError &lt; WebratError
   end
@@ -17,6 +19,7 @@ module Webrat
   end
   
   class SeleniumSession
+    include Webrat::SaveAndOpenPage
     
     def initialize(*args) # :nodoc:
     end
@@ -53,7 +56,7 @@ module Webrat
     def click_button(button_text_or_regexp = nil, options = {})
       if button_text_or_regexp.is_a?(Hash) &amp;&amp; options == {}
         pattern, options = nil, button_text_or_regexp
-      else
+      elsif button_text_or_regexp
         pattern = adjust_if_regexp(button_text_or_regexp)
       end
       pattern ||= '*'
@@ -160,6 +163,20 @@ module Webrat
     
     webrat_deprecate :browser, :selenium
     
+    
+    def save_and_open_screengrab
+      return unless File.exist?(saved_page_dir)
+      
+      filename = &quot;#{saved_page_dir}/webrat-#{Time.now.to_i}.png&quot;
+         
+      if $browser.chrome_backend?
+        $browser.capture_entire_page_screenshot(filename, '')
+      else
+        $browser.capture_screenshot(filename)
+      end
+        open_in_browser(filename)
+    end
+    
   protected
     
     def setup #:nodoc:
@@ -175,6 +192,7 @@ module Webrat
       
       extend_selenium
       define_location_strategies
+      $browser.window_maximize
     end
     
     def teardown_at_exit #:nodoc:
@@ -191,7 +209,7 @@ module Webrat
       if text_or_regexp.is_a?(Regexp)
         &quot;evalregex:#{text_or_regexp.inspect}&quot;
       else
-        text_or_regexp
+        &quot;evalregex:/#{text_or_regexp}/&quot;
       end 
     end
     </diff>
      <filename>lib/webrat/selenium/selenium_session.rb</filename>
    </modified>
    <modified>
      <diff>@@ -330,7 +330,7 @@ describe &quot;click_button&quot; do
   end
   
   it &quot;should properly handle HTML entities in textarea default values&quot; do
-    pending &quot;needs bug fix&quot; do
+    spec = lambda do
       with_html &lt;&lt;-HTML
         &lt;html&gt;
         &lt;form method=&quot;post&quot; action=&quot;/posts&quot;&gt;
@@ -342,6 +342,12 @@ describe &quot;click_button&quot; do
       webrat_session.should_receive(:post).with(&quot;/posts&quot;, &quot;post&quot; =&gt; {&quot;body&quot; =&gt; &quot;Peanut butter &amp; jelly&quot;})
       click_button
     end
+    
+    if Webrat.on_java?
+      spec.call
+    else
+      pending(&quot;needs bug fix&quot;, &amp;spec)
+    end
   end
   
   it &quot;should send default selected option value from select&quot; do</diff>
      <filename>spec/api/click_button_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -201,7 +201,7 @@ describe &quot;select&quot; do
   end
   
   it &quot;should properly handle submitting HTML entities in select values&quot; do
-    pending &quot;needs bug fix&quot; do
+    spec = lambda do
       with_html &lt;&lt;-HTML
         &lt;html&gt;
         &lt;form method=&quot;post&quot; action=&quot;/login&quot;&gt;
@@ -213,10 +213,16 @@ describe &quot;select&quot; do
       webrat_session.should_receive(:post).with(&quot;/login&quot;, &quot;month&quot; =&gt; &quot;Peanut butter &amp; jelly&quot;)
       click_button
     end
+    
+    if Webrat.on_java?
+      spec.call
+    else
+      pending(&quot;needs bug fix&quot;, &amp;spec)
+    end
   end
   
   it &quot;should properly handle locating with HTML entities in select values&quot; do
-    pending &quot;needs bug fix&quot; do
+    spec = lambda do
       with_html &lt;&lt;-HTML
         &lt;html&gt;
         &lt;form method=&quot;post&quot; action=&quot;/login&quot;&gt;
@@ -230,5 +236,11 @@ describe &quot;select&quot; do
         select &quot;Peanut butter &amp; jelly&quot;
       }.should_not raise_error(Webrat::NotFoundError)
     end
+    
+    if Webrat.on_java?
+      spec.call
+    else
+      pending(&quot;needs bug fix&quot;, &amp;spec)
+    end
   end
 end</diff>
      <filename>spec/api/select_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -58,6 +58,28 @@ describe &quot;within&quot; do
     end
   end
   
+  it &quot;should work when the scope is inside the form&quot; do
+    pending &quot;needs bug fix&quot; do
+      with_html &lt;&lt;-HTML
+        &lt;html&gt;
+          &lt;form id=&quot;form2&quot; action=&quot;/form2&quot;&gt;
+            &lt;div class=&quot;important&quot;&gt;
+              &lt;label&gt;Email: &lt;input type=&quot;text&quot; class=&quot;email2&quot; name=&quot;email&quot; /&gt;&lt;/label&gt;
+            &lt;/div&gt;
+            &lt;input type=&quot;submit&quot; value=&quot;Add&quot; /&gt;
+          &lt;/form&gt;
+        &lt;/html&gt;
+      HTML
+    
+      webrat_session.should_receive(:get).with(&quot;/form2&quot;, &quot;email&quot; =&gt; &quot;test@example.com&quot;)
+      within &quot;.important&quot; do
+        fill_in &quot;Email&quot;, :with =&gt; &quot;test@example.com&quot;
+      end
+    
+      submit_form &quot;form2&quot;
+    end
+  end
+  
   it &quot;should not find buttons outside of the scope&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;</diff>
      <filename>spec/api/within_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,15 +7,24 @@ begin require &quot;redgreen&quot; unless ENV['TM_CURRENT_LINE']; rescue LoadError; end
 webrat_path = File.expand_path(File.dirname(__FILE__) + &quot;/../lib/&quot;)
 $LOAD_PATH.unshift(webrat_path) unless $LOAD_PATH.include?(webrat_path)
 
-require &quot;merb-core&quot;
-require &quot;webrat/merb&quot;
-
 require &quot;webrat&quot;
 require File.expand_path(File.dirname(__FILE__) + &quot;/fakes/test_session&quot;)
 
+module Webrat
+  @@previous_config = nil
+
+  def self.cache_config_for_test
+    @@previous_config = Webrat.configuration.clone
+  end
+
+  def self.reset_for_test
+    @@configuration = @@previous_config if @@previous_config
+  end
+end
+
 Spec::Runner.configure do |config|
   include Webrat::Methods
-
+  
   def with_html(html)
     raise &quot;This doesn't look like HTML. Wrap it in a &lt;html&gt; tag&quot; unless html =~ /^\s*&lt;[^Hh&gt;]*html/i
     webrat_session.response_body = html
@@ -26,22 +35,15 @@ Spec::Runner.configure do |config|
     webrat_session.response_body = xml
   end
   
-end
-
-module Webrat
-  @@previous_config = nil
-
-  def self.cache_config_for_test
-    @@previous_config = Webrat.configuration.clone
-  end
-
-  def self.reset_for_test
-    @@configuration = @@previous_config if @@previous_config
+  config.before :each do
+    Webrat.cache_config_for_test
   end
   
-  class Configuration
-    def mode_for_test= (mode)
-      @mode = mode
-    end
+  config.after :each do
+    Webrat.reset_for_test
   end
+end
+
+Webrat.configure do |config|
+  config.mode = :merb
 end
\ No newline at end of file</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,14 +4,6 @@ describe Webrat::Configuration do
   predicate_matchers[:parse_with_nokogiri]  = :parse_with_nokogiri?
   predicate_matchers[:open_error_files]     = :open_error_files?
 
-  before do
-    Webrat.cache_config_for_test
-  end
-  
-  after do
-    Webrat.reset_for_test
-  end
-
   it &quot;should have a mode&quot; do
     Webrat.configuration.should respond_to(:mode)
   end</diff>
      <filename>spec/webrat/core/configuration_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,20 @@
 require File.expand_path(File.dirname(__FILE__) + &quot;/../../spec_helper&quot;)
 
 module Webrat
+  describe Field do
+    it &quot;should have nice inspect output&quot; do
+      html = &lt;&lt;-HTML
+        &lt;html&gt;
+        &lt;input type='checkbox' checked='checked' /&gt;
+        &lt;/html&gt;
+      HTML
+      
+      element = Webrat::XML.css_search(Webrat::XML.document(html), &quot;input&quot;).first
+      checkbox = CheckboxField.new(nil, element)
+      checkbox.inspect.should =~ /#&lt;Webrat::CheckboxField @element=&lt;input type=['&quot;]checkbox['&quot;] checked(=['&quot;]checked['&quot;])?\/?&gt;&gt;/
+    end
+  end
+  
   describe CheckboxField do
     it &quot;should say it is checked if it is&quot; do
       html = &lt;&lt;-HTML</diff>
      <filename>spec/webrat/core/field_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -87,12 +87,8 @@ describe Webrat::Session do
 
   describe &quot;#request_page&quot; do
     before(:each) do
-      Webrat.cache_config_for_test
       webrat_session = Webrat::Session.new
     end
-    after(:each) do
-      Webrat.reset_for_test
-    end
   
     it &quot;should raise an error if the request is not a success&quot; do
       webrat_session.stub!(:get)</diff>
      <filename>spec/webrat/core/session_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
 require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
-require &quot;mechanize&quot;
+
 require &quot;webrat/mechanize&quot;
 
 describe Webrat::MechanizeSession do
-  
+
+  before :each do
+    Webrat.configuration.mode = :mechanize
+  end
+
   before(:each) do
     @mech = Webrat::MechanizeSession.new
   end
@@ -34,4 +38,45 @@ describe Webrat::MechanizeSession do
       Webrat::MechanizeSession.new.post(url, data)
     end
   end
+  
+  describe &quot;#absolute_url&quot; do
+    before(:each) do
+      @session = Webrat::MechanizeSession.new
+      @session.stub!(:current_url).and_return(absolute_url)
+    end
+    
+    def absolute_url
+      'http://test.host/users/fred/cabbages'
+    end
+    
+    def rooted_url
+      '/users/fred/cabbages'
+    end
+    
+    def relative_url
+      '../../wilma'
+    end
+    
+    it &quot;should return unmodified url if prefixed with scheme&quot; do
+      @session.absolute_url(absolute_url).should == absolute_url
+    end
+    
+    it &quot;should prefix scheme and hostname if url begins with /&quot; do
+      @session.absolute_url(rooted_url).should == absolute_url
+    end
+    
+    it &quot;should resolve sibling URLs relative to current path&quot; do
+      @session.absolute_url(relative_url).should == 'http://test.host/users/wilma'
+    end
+    
+    it &quot;should cope with sibling URLs from root of site&quot; do
+      @session.stub!(:current_url).and_return('http://test.host')
+      @session.absolute_url(relative_url).should == 'http://test.host/wilma'
+    end
+    
+    it &quot;should cope with https&quot; do
+      @session.stub!(:current_url).and_return('https://test.host')
+      @session.absolute_url(relative_url).should == 'https://test.host/wilma'
+    end
+  end
 end
\ No newline at end of file</diff>
      <filename>spec/webrat/mechanize/mechanize_session_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,4 @@
 require File.expand_path(File.dirname(__FILE__) + &quot;/../../spec_helper&quot;)
-require File.expand_path(File.dirname(__FILE__) + &quot;/helper&quot;)
 
 describe HashWithIndifferentAccess do
   it &quot;should not update constructor when not a hash&quot; do</diff>
      <filename>spec/webrat/merb/indifferent_access_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,8 @@
-require File.expand_path(File.dirname(__FILE__) + '/helper')
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 
 describe &quot;attach_file&quot; do
   before do
+    Webrat.configuration.mode = :rails
     @filename = __FILE__
     @uploaded_file = mock(&quot;uploaded file&quot;)
     ActionController::TestUploadedFile.stub!(:new =&gt; @uploaded_file)</diff>
      <filename>spec/webrat/rails/attaches_file_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,12 @@
-require File.expand_path(File.dirname(__FILE__) + '/helper')
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+
+require &quot;webrat/rails&quot;
 
 describe Webrat::RailsSession do
+  before do
+    Webrat.configuration.mode = :rails
+  end
+  
   it &quot;should delegate response_body to the session response body&quot; do
     response = mock(&quot;response&quot;, :body =&gt; &quot;&lt;html&gt;&quot;)
     integration_session = mock(&quot;integration session&quot;, :response =&gt; response)
@@ -69,6 +75,15 @@ describe Webrat::RailsSession do
     end
   end
   
+  context &quot;the URL include an anchor&quot; do
+    it &quot;should strip out the anchor&quot; do
+      integration_session = mock(&quot;integration session&quot;, :https! =&gt; false)
+      rails_session = Webrat::RailsSession.new(integration_session)
+      integration_session.should_receive(:request_via_redirect).with(:get, &quot;/url&quot;, &quot;data&quot;, &quot;headers&quot;)
+      rails_session.get(&quot;http://www.example.com/url#foo&quot;, &quot;data&quot;, &quot;headers&quot;)
+    end
+  end
+  
   it &quot;should provide a saved_page_dir&quot; do
     Webrat::RailsSession.new(mock(&quot;integration session&quot;)).should respond_to(:saved_page_dir)
   end</diff>
      <filename>spec/webrat/rails/rails_session_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,14 @@
 Gem::Specification.new do |s|
   s.name = %q{webrat}
-  s.version = &quot;0.3.2.1&quot;
+  s.version = &quot;0.3.2.2&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Bryan Helmkamp&quot;]
-  s.date = %q{2008-11-30}
+  s.date = %q{2008-12-25}
   s.description = %q{Webrat. Ruby Acceptance Testing for Web applications}
   s.email = %q{bryan@brynary.com}
   s.extra_rdoc_files = [&quot;README.rdoc&quot;, &quot;MIT-LICENSE.txt&quot;]
-  s.files = [&quot;History.txt&quot;, &quot;install.rb&quot;, &quot;MIT-LICENSE.txt&quot;, &quot;README.rdoc&quot;, &quot;Rakefile&quot;, &quot;lib/webrat&quot;, &quot;lib/webrat/core&quot;, &quot;lib/webrat/core/configuration.rb&quot;, &quot;lib/webrat/core/elements&quot;, &quot;lib/webrat/core/elements/area.rb&quot;, &quot;lib/webrat/core/elements/element.rb&quot;, &quot;lib/webrat/core/elements/field.rb&quot;, &quot;lib/webrat/core/elements/form.rb&quot;, &quot;lib/webrat/core/elements/label.rb&quot;, &quot;lib/webrat/core/elements/link.rb&quot;, &quot;lib/webrat/core/elements/select_option.rb&quot;, &quot;lib/webrat/core/locators&quot;, &quot;lib/webrat/core/locators/area_locator.rb&quot;, &quot;lib/webrat/core/locators/button_locator.rb&quot;, &quot;lib/webrat/core/locators/field_by_id_locator.rb&quot;, &quot;lib/webrat/core/locators/field_labeled_locator.rb&quot;, &quot;lib/webrat/core/locators/field_locator.rb&quot;, &quot;lib/webrat/core/locators/field_named_locator.rb&quot;, &quot;lib/webrat/core/locators/form_locator.rb&quot;, &quot;lib/webrat/core/locators/label_locator.rb&quot;, &quot;lib/webrat/core/locators/link_locator.rb&quot;, &quot;lib/webrat/core/locators/locator.rb&quot;, &quot;lib/webrat/core/locators/select_option_locator.rb&quot;, &quot;lib/webrat/core/locators.rb&quot;, &quot;lib/webrat/core/logging.rb&quot;, &quot;lib/webrat/core/matchers&quot;, &quot;lib/webrat/core/matchers/have_content.rb&quot;, &quot;lib/webrat/core/matchers/have_selector.rb&quot;, &quot;lib/webrat/core/matchers/have_tag.rb&quot;, &quot;lib/webrat/core/matchers/have_xpath.rb&quot;, &quot;lib/webrat/core/matchers.rb&quot;, &quot;lib/webrat/core/methods.rb&quot;, &quot;lib/webrat/core/mime.rb&quot;, &quot;lib/webrat/core/scope.rb&quot;, &quot;lib/webrat/core/session.rb&quot;, &quot;lib/webrat/core/xml&quot;, &quot;lib/webrat/core/xml/hpricot.rb&quot;, &quot;lib/webrat/core/xml/nokogiri.rb&quot;, &quot;lib/webrat/core/xml/rexml.rb&quot;, &quot;lib/webrat/core/xml.rb&quot;, &quot;lib/webrat/core.rb&quot;, &quot;lib/webrat/core_extensions&quot;, &quot;lib/webrat/core_extensions/blank.rb&quot;, &quot;lib/webrat/core_extensions/deprecate.rb&quot;, &quot;lib/webrat/core_extensions/detect_mapped.rb&quot;, &quot;lib/webrat/core_extensions/hash_with_indifferent_access.rb&quot;, &quot;lib/webrat/core_extensions/meta_class.rb&quot;, &quot;lib/webrat/core_extensions/nil_to_param.rb&quot;, &quot;lib/webrat/mechanize.rb&quot;, &quot;lib/webrat/merb.rb&quot;, &quot;lib/webrat/rack.rb&quot;, &quot;lib/webrat/rails&quot;, &quot;lib/webrat/rails/redirect_actions.rb&quot;, &quot;lib/webrat/rails.rb&quot;, &quot;lib/webrat/rspec-rails.rb&quot;, &quot;lib/webrat/selenium&quot;, &quot;lib/webrat/selenium/location_strategy_javascript&quot;, &quot;lib/webrat/selenium/location_strategy_javascript/button.js&quot;, &quot;lib/webrat/selenium/location_strategy_javascript/label.js&quot;, &quot;lib/webrat/selenium/location_strategy_javascript/webrat.js&quot;, &quot;lib/webrat/selenium/location_strategy_javascript/webratlink.js&quot;, &quot;lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js&quot;, &quot;lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js&quot;, &quot;lib/webrat/selenium/selenium_extensions.js&quot;, &quot;lib/webrat/selenium/selenium_session.rb&quot;, &quot;lib/webrat/selenium.rb&quot;, &quot;lib/webrat/sinatra.rb&quot;, &quot;lib/webrat.rb&quot;, &quot;vendor/selenium-server.jar&quot;]
+  s.files = [&quot;History.txt&quot;, &quot;install.rb&quot;, &quot;MIT-LICENSE.txt&quot;, &quot;README.rdoc&quot;, &quot;Rakefile&quot;, &quot;lib/webrat&quot;, &quot;lib/webrat/core&quot;, &quot;lib/webrat/core/configuration.rb&quot;, &quot;lib/webrat/core/elements&quot;, &quot;lib/webrat/core/elements/area.rb&quot;, &quot;lib/webrat/core/elements/element.rb&quot;, &quot;lib/webrat/core/elements/field.rb&quot;, &quot;lib/webrat/core/elements/form.rb&quot;, &quot;lib/webrat/core/elements/label.rb&quot;, &quot;lib/webrat/core/elements/link.rb&quot;, &quot;lib/webrat/core/elements/select_option.rb&quot;, &quot;lib/webrat/core/locators&quot;, &quot;lib/webrat/core/locators/area_locator.rb&quot;, &quot;lib/webrat/core/locators/button_locator.rb&quot;, &quot;lib/webrat/core/locators/field_by_id_locator.rb&quot;, &quot;lib/webrat/core/locators/field_labeled_locator.rb&quot;, &quot;lib/webrat/core/locators/field_locator.rb&quot;, &quot;lib/webrat/core/locators/field_named_locator.rb&quot;, &quot;lib/webrat/core/locators/form_locator.rb&quot;, &quot;lib/webrat/core/locators/label_locator.rb&quot;, &quot;lib/webrat/core/locators/link_locator.rb&quot;, &quot;lib/webrat/core/locators/locator.rb&quot;, &quot;lib/webrat/core/locators/select_option_locator.rb&quot;, &quot;lib/webrat/core/locators.rb&quot;, &quot;lib/webrat/core/logging.rb&quot;, &quot;lib/webrat/core/matchers&quot;, &quot;lib/webrat/core/matchers/have_content.rb&quot;, &quot;lib/webrat/core/matchers/have_selector.rb&quot;, &quot;lib/webrat/core/matchers/have_tag.rb&quot;, &quot;lib/webrat/core/matchers/have_xpath.rb&quot;, &quot;lib/webrat/core/matchers.rb&quot;, &quot;lib/webrat/core/methods.rb&quot;, &quot;lib/webrat/core/mime.rb&quot;, &quot;lib/webrat/core/save_and_open_page.rb&quot;, &quot;lib/webrat/core/scope.rb&quot;, &quot;lib/webrat/core/session.rb&quot;, &quot;lib/webrat/core/xml&quot;, &quot;lib/webrat/core/xml/hpricot.rb&quot;, &quot;lib/webrat/core/xml/nokogiri.rb&quot;, &quot;lib/webrat/core/xml/rexml.rb&quot;, &quot;lib/webrat/core/xml.rb&quot;, &quot;lib/webrat/core.rb&quot;, &quot;lib/webrat/core_extensions&quot;, &quot;lib/webrat/core_extensions/blank.rb&quot;, &quot;lib/webrat/core_extensions/deprecate.rb&quot;, &quot;lib/webrat/core_extensions/detect_mapped.rb&quot;, &quot;lib/webrat/core_extensions/hash_with_indifferent_access.rb&quot;, &quot;lib/webrat/core_extensions/meta_class.rb&quot;, &quot;lib/webrat/core_extensions/nil_to_param.rb&quot;, &quot;lib/webrat/mechanize.rb&quot;, &quot;lib/webrat/merb.rb&quot;, &quot;lib/webrat/rack.rb&quot;, &quot;lib/webrat/rails&quot;, &quot;lib/webrat/rails/redirect_actions.rb&quot;, &quot;lib/webrat/rails.rb&quot;, &quot;lib/webrat/rspec-rails.rb&quot;, &quot;lib/webrat/selenium&quot;, &quot;lib/webrat/selenium/location_strategy_javascript&quot;, &quot;lib/webrat/selenium/location_strategy_javascript/button.js&quot;, &quot;lib/webrat/selenium/location_strategy_javascript/label.js&quot;, &quot;lib/webrat/selenium/location_strategy_javascript/webrat.js&quot;, &quot;lib/webrat/selenium/location_strategy_javascript/webratlink.js&quot;, &quot;lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js&quot;, &quot;lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js&quot;, &quot;lib/webrat/selenium/matchers.rb&quot;, &quot;lib/webrat/selenium/selenium_extensions.js&quot;, &quot;lib/webrat/selenium/selenium_session.rb&quot;, &quot;lib/webrat/selenium.rb&quot;, &quot;lib/webrat/sinatra.rb&quot;, &quot;lib/webrat.rb&quot;, &quot;vendor/selenium-server.jar&quot;]
   s.has_rdoc = true
   s.homepage = %q{http://github.com/brynary/webrat}
   s.require_paths = [&quot;lib&quot;]</diff>
      <filename>webrat.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fbcd5090973919e7e68d878ba65d1d8bd835901e</id>
    </parent>
  </parents>
  <author>
    <name>Mike Gaffney</name>
    <email>mike@uberu.com</email>
  </author>
  <url>http://github.com/brynary/webrat/commit/449edf4a10578844792ddd62919187a291d25065</url>
  <id>449edf4a10578844792ddd62919187a291d25065</id>
  <committed-date>2008-12-27T15:22:51-08:00</committed-date>
  <authored-date>2008-12-27T15:22:51-08:00</authored-date>
  <message>updated from master</message>
  <tree>6ab64d6d29b168690d32660085d3929747fea1d6</tree>
  <committer>
    <name>Mike Gaffney</name>
    <email>mike@uberu.com</email>
  </committer>
</commit>
