Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Return html inside textareas when page is loaded. Closes #1025"

It seems like textareas must not contain HTML content according to the
HTML spec.

This reverts commit ca4781f.

Conflicts:
	lib/capybara/spec/session/node_spec.rb
  • Loading branch information...
commit 2d5c8e066f6c51a8937f38559f16d22bc3db769c 1 parent 6ce45f2
@jnicklas authored
View
2  lib/capybara/node/simple.rb
@@ -74,7 +74,7 @@ def path
#
def value
if tag_name == 'textarea'
- native.inner_html.sub(/\A\n/, '')
+ native.content.sub(/\A\n/, '')
elsif tag_name == 'select'
if native['multiple'] == 'multiple'
native.xpath(".//option[@selected='selected']").map { |option| option[:value] || option.content }
View
2  lib/capybara/rack_test/form.rb
@@ -60,7 +60,7 @@ def params(button)
merge_param!(params, field['name'].to_s, (option['value'] || option.text).to_s) if option
end
when 'textarea'
- merge_param!(params, field['name'].to_s, field.inner_html.to_s)
+ merge_param!(params, field['name'].to_s, field.text.to_s)
end
end
merge_param!(params, button[:name], button[:value] || "") if button[:name]
View
2  lib/capybara/rack_test/node.rb
@@ -27,7 +27,7 @@ def set(value)
elsif input_field?
set_input(value)
elsif textarea?
- native.inner_html = value.to_s unless self[:readonly]
+ native.content = value.to_s unless self[:readonly]
end
end
View
6 lib/capybara/spec/session/node_spec.rb
@@ -58,14 +58,10 @@
@session.find('//textarea[@id="additional_newline"]').value.should == "\nbanana"
end
- it "return any HTML content added to textarea" do
+ it "return any HTML content in textarea" do
@session.find('//textarea[1]').set("some <em>html</em> here")
@session.find('//textarea[1]').value.should == "some <em>html</em> here"
end
-
- it "return any HTML content in textarea" do
- @session.find(:css, 'textarea#with-html').value.should == "contains <em>html</em>"
- end
end
describe "#set" do
View
1  lib/capybara/spec/views/with_html.erb
@@ -37,7 +37,6 @@ banana</textarea>
banana</textarea>
<textarea readonly="readonly">textarea should not change</textarea>
- <textarea id="with-html">contains <em>html</em></textarea>
<a href="/redirect_back">BackToMyself</a>
<a title="twas a fine link" href="/redirect">A link came first</a>
<a title="a fine link" href="/with_simple_html">A link</a>
Please sign in to comment.
Something went wrong with that request. Please try again.