Test click_button by id

This commit is contained in:
Jonas Nicklas 2009-11-08 01:29:03 +01:00
parent e113e2e9c5
commit 971e98450b
2 changed files with 10 additions and 2 deletions

View File

@ -63,6 +63,14 @@ shared_examples_for "session" do
results['foo'].should == 'blah'
end
end
context "with id given" do
it "should submit the associated form" do
@session.click_button('awe123')
results = YAML.load(@session.body)
results['foo'].should == 'blah'
end
end
end
end

View File

@ -10,7 +10,7 @@
</p>
<p>
<input type="submit" name="form[awesome]" value="awesome"/>
<input type="submit" name="form[crappy]" value="crappy"/>
<input type="submit" name="form[awesome]" id="awe123" value="awesome"/>
<input type="submit" name="form[crappy]" id="crap321" value="crappy"/>
</p>
</form>