require File.expand_path(File.dirname(__FILE__) + "/../spec_helper") describe "submit_form" do it "should submit forms by ID" do with_html <<-HTML
HTML webrat_session.should_receive(:get).with("/form1", "email" => "test@example.com") fill_in "Email", :with => "test@example.com" submit_form "form1" end it "should submit forms by CSS" do with_html <<-HTML
HTML webrat_session.should_receive(:get).with("/form1", "email" => "test@example.com") fill_in "Email", :with => "test@example.com" submit_form "form[action='/form1']" end it "should give priority to selecting forms by ID" do with_html <<-HTML
HTML webrat_session.should_receive(:get).with("/form2", "email" => "test@example.com") fill_in "Another email", :with => "test@example.com" submit_form "form" end end