aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/testing/assertions
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-03-30 11:39:18 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2012-03-30 11:40:23 -0300
commit1141f71601ff61fb299c86d814c07209f1430024 (patch)
treeece1af5b7871e68c318e05f679aeb343802352bb /actionpack/lib/action_dispatch/testing/assertions
parent1ce75450a9fba33edf2bffee0bf0ac3d31ea677f (diff)
downloadrails-1141f71601ff61fb299c86d814c07209f1430024.tar.gz
rails-1141f71601ff61fb299c86d814c07209f1430024.tar.bz2
rails-1141f71601ff61fb299c86d814c07209f1430024.zip
Remove the leading \n added by textarea on assert_select
Diffstat (limited to 'actionpack/lib/action_dispatch/testing/assertions')
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions/selector.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb
index 8eed85bce2..ea1ed20f3c 100644
--- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb
@@ -269,6 +269,7 @@ module ActionDispatch
end
end
text.strip! unless NO_STRIP.include?(match.name)
+ text.sub!(/\A\n/, '') if match.name == "textarea"
unless match_with.is_a?(Regexp) ? (text =~ match_with) : (text == match_with.to_s)
content_mismatch ||= sprintf("<%s> expected but was\n<%s>.", match_with, text)
true