<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -74,6 +74,10 @@ module Webrat
       labels.detect { |label| label.matches_text?(label_text) }
     end
     
+    def matches_id?(id)
+      @element[&quot;id&quot;] == id.to_s
+    end
+    
   protected
   
     def fields_by_type(field_types)</diff>
      <filename>lib/webrat/core/form.rb</filename>
    </modified>
    <modified>
      <diff>@@ -44,6 +44,11 @@ module Webrat
 
     alias_method :fills_in, :fill_in
     
+    def set_hidden_field(field_locator, options = {})
+      field = locate_field(field_locator, HiddenField)
+      field.set(options[:to])
+    end
+    
     # Verifies that an input checkbox exists on the current page and marks it
     # as checked, so that the value will be submitted with the form.
     #
@@ -256,6 +261,11 @@ module Webrat
 
     alias_method :clicks_button, :click_button
     
+    def submit_form(id)
+      form = forms.detect { |f| f.matches_id?(id) }
+      form.submit
+    end
+    
     def dom # :nodoc:
       return @dom if @dom
       </diff>
      <filename>lib/webrat/core/scope.rb</filename>
    </modified>
    <modified>
      <diff>@@ -180,6 +180,8 @@ module Webrat
     end
     
     def_delegators :current_scope, :fill_in,            :fills_in
+    def_delegators :current_scope, :set_hidden_field
+    def_delegators :current_scope, :submit_form
     def_delegators :current_scope, :check,              :checks
     def_delegators :current_scope, :uncheck,            :unchecks
     def_delegators :current_scope, :choose,             :chooses</diff>
      <filename>lib/webrat/core/session.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3abaa924cc289dde19e004ae27292d0159e2b606</id>
    </parent>
  </parents>
  <author>
    <name>Bryan Helmkamp</name>
    <email>bryan@brynary.com</email>
  </author>
  <url>http://github.com/brynary/webrat/commit/5ee4357cd69fb14057729301a8b6328efca60134</url>
  <id>5ee4357cd69fb14057729301a8b6328efca60134</id>
  <committed-date>2008-11-17T11:21:16-08:00</committed-date>
  <authored-date>2008-11-17T11:21:16-08:00</authored-date>
  <message>Add set_hidden_field and submit_form methods ND/BH</message>
  <tree>ae1d42a5be5503758f5794cac0abb87cecacf296</tree>
  <committer>
    <name>Bryan Helmkamp</name>
    <email>bryan@brynary.com</email>
  </committer>
</commit>
