mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Add spec for preferring exact matches for fill_in
This commit is contained in:
parent
af11569ff4
commit
2ff6e65b2c
2 changed files with 11 additions and 0 deletions
|
@ -71,6 +71,12 @@ module FillInSpec
|
||||||
extract_results(@session)['password'].should == 'supasikrit'
|
extract_results(@session)['password'].should == 'supasikrit'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should prefer exact matches over partial matches" do
|
||||||
|
@session.fill_in('Name', :with => 'Ford Prefect')
|
||||||
|
@session.click_button('awesome')
|
||||||
|
extract_results(@session)['name'].should == 'Ford Prefect'
|
||||||
|
end
|
||||||
|
|
||||||
context "with a locator that doesn't exist" do
|
context "with a locator that doesn't exist" do
|
||||||
it "should raise an error" do
|
it "should raise an error" do
|
||||||
running do
|
running do
|
||||||
|
|
|
@ -13,6 +13,11 @@
|
||||||
<input type="text" name="form[last_name]" value="Smith" id="form_last_name"/>
|
<input type="text" name="form[last_name]" value="Smith" id="form_last_name"/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<label for="form_name_explanation">Explanation of Name</label>
|
||||||
|
<textarea name="form[name_explanation]" id="form_name_explanation"></textarea>
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<label for="form_name">Name</label>
|
<label for="form_name">Name</label>
|
||||||
<input type="text" name="form[name]" value="John Smith" id="form_name"/>
|
<input type="text" name="form[name]" value="John Smith" id="form_name"/>
|
||||||
|
|
Loading…
Reference in a new issue