mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Add test so that will fail on incorrectly scoped selects
This commit is contained in:
parent
35e81a434f
commit
5cf2b55cca
2 changed files with 19 additions and 1 deletions
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue