From 5c7bb86a1bafbc6f067452768f37e566d6020918 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Fri, 30 Mar 2012 11:39:18 -0300 Subject: Remove the leading \n added by textarea on assert_select --- actionpack/lib/action_dispatch/testing/assertions/selector.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/lib/action_dispatch/testing/assertions/selector.rb') 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 -- cgit v1.2.3