Aliased find_field to field_labeled for webrat compat
This commit is contained in:
parent
2ec699ad9c
commit
dcc082337e
|
@ -99,6 +99,7 @@ class Capybara::Session
|
|||
raise Capybara::ElementNotFound, "no field of kind #{kinds.inspect} with id or label '#{locator}' found" unless field
|
||||
field
|
||||
end
|
||||
alias_method :field_labeled, :find_field
|
||||
|
||||
private
|
||||
|
||||
|
|
|
@ -481,6 +481,13 @@ shared_examples_for "session" do
|
|||
@session.find_field('form_description', :password_field)
|
||||
}.should raise_error(Capybara::ElementNotFound)
|
||||
end
|
||||
|
||||
it "should be aliased as 'field_labeled' for webrat compatibility" do
|
||||
@session.field_labeled('Dog').value.should == 'dog'
|
||||
running {
|
||||
@session.field_labeled('Does not exist')
|
||||
}.should raise_error(Capybara::ElementNotFound)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#within' do
|
||||
|
|
Loading…
Reference in New Issue