Add test so that will fail on incorrectly scoped selects

This commit is contained in:
Steven Parkes 2010-07-01 19:45:02 -07:00
parent 35e81a434f
commit 5cf2b55cca
2 changed files with 19 additions and 1 deletions

View File

@ -37,7 +37,15 @@ shared_examples_for "select" do
extract_results(@session)['locale'].should == 'jo'
end
it "match labels with preceding or trailing whitespace" do
it "should obey from" do
@session.select("Miss", :from => "Other title")
@session.click_button('awesome')
results = extract_results(@session)
results['other_title'].should == "Miss"
results['title'].should_not == "Miss"
end
it "show match labels with preceding or trailing whitespace" do
@session.select("Lojban", :from => 'Locale')
@session.click_button('awesome')
extract_results(@session)['locale'].should == 'jbo'

View File

@ -11,6 +11,16 @@
</select>
</p>
<p>
<label for="form_other_title">Other title</label>
<select name="form[other_title]" id="form_other_title">
<option>Mrs</option>
<option>Mr</option>
<option>Miss</option>
</select>
</p>
<p>
<label for="form_first_name">
First Name