Merge commit 'lenalena/master' into lh_139
This commit is contained in:
commit
7f9df54838
|
@ -45,6 +45,7 @@ module Webrat
|
|||
when "file" then FileField
|
||||
when "reset" then ResetField
|
||||
when "submit" then ButtonField
|
||||
when "button" then ButtonField
|
||||
when "image" then ButtonField
|
||||
else TextField
|
||||
end
|
||||
|
@ -177,7 +178,7 @@ module Webrat
|
|||
class ButtonField < Field #:nodoc:
|
||||
|
||||
def self.xpath_search
|
||||
[".//button", ".//input[@type = 'submit']", ".//input[@type = 'image']"]
|
||||
[".//button", ".//input[@type = 'submit']", ".//input[@type = 'button']", ".//input[@type = 'image']"]
|
||||
end
|
||||
|
||||
def to_param
|
||||
|
|
|
@ -425,7 +425,7 @@ describe "click_button" do
|
|||
webrat_session.should_receive(:get).with("/login", "user" => {"email" => ""})
|
||||
click_button
|
||||
end
|
||||
|
||||
|
||||
it "should recognize button tags" do
|
||||
with_html <<-HTML
|
||||
<html>
|
||||
|
@ -439,6 +439,18 @@ describe "click_button" do
|
|||
click_button
|
||||
end
|
||||
|
||||
it "should recognize input tags with the type button" do
|
||||
with_html <<-HTML
|
||||
<html>
|
||||
<form action="/">
|
||||
<input type="button" />
|
||||
</form>
|
||||
</html>
|
||||
HTML
|
||||
webrat_session.should_receive(:get)
|
||||
click_button
|
||||
end
|
||||
|
||||
it "should recognize image button tags" do
|
||||
with_html <<-HTML
|
||||
<html>
|
||||
|
|
Loading…
Reference in New Issue