aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/testing
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:44:15 -0300
commit13fe1903d89fa9345a9f0b17de2d31e8b7ef2b1d (patch)
treef12ddeed846cc2c755d197db2c1cc8022a97065e /actionpack/lib/action_dispatch/testing
parent1d753ab6c8bb8d4fb25ddb48d3859fd371bedae6 (diff)
downloadrails-13fe1903d89fa9345a9f0b17de2d31e8b7ef2b1d.tar.gz
rails-13fe1903d89fa9345a9f0b17de2d31e8b7ef2b1d.tar.bz2
rails-13fe1903d89fa9345a9f0b17de2d31e8b7ef2b1d.zip
Remove the leading \n added by textarea on assert_select
Diffstat (limited to 'actionpack/lib/action_dispatch/testing')
-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 b4555f4f59..afbd869152 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 ||= build_message(message, "<?> expected but was\n<?>.", match_with, text)
true