Support Textareas#value
This commit is contained in:
parent
32c1502449
commit
c621e651c9
|
@ -86,11 +86,11 @@ describe Capybara::Session, "with TestApp" do
|
||||||
@session = Capybara::Session.new(:reusable_webkit, TestApp)
|
@session = Capybara::Session.new(:reusable_webkit, TestApp)
|
||||||
end
|
end
|
||||||
|
|
||||||
def extract_results(session)
|
# def extract_results(session)
|
||||||
YAML.load Nokogiri::HTML(session.body).xpath("//pre[@id='results']").first.text
|
# YAML.load Nokogiri::HTML(session.body).xpath("//pre[@id='results']").first.text
|
||||||
end
|
# end
|
||||||
|
|
||||||
it_should_behave_like 'attach_file'
|
# it_should_behave_like 'attach_file'
|
||||||
# it_should_behave_like "session"
|
it_should_behave_like "session"
|
||||||
# it_should_behave_like "session with javascript support"
|
# it_should_behave_like "session with javascript support"
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,7 +28,13 @@ Capybara = {
|
||||||
},
|
},
|
||||||
|
|
||||||
text: function (index) {
|
text: function (index) {
|
||||||
return this.nodes[index].innerText;
|
var node = this.nodes[index];
|
||||||
|
var type = (node.type || node.tagName).toLowerCase();
|
||||||
|
if (type == "textarea") {
|
||||||
|
return node.innerHTML;
|
||||||
|
} else {
|
||||||
|
return node.innerText;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
attribute: function (index, name) {
|
attribute: function (index, name) {
|
||||||
|
|
Loading…
Reference in New Issue