aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2011-02-10 16:45:39 +0100
committerJosé Valim <jose.valim@gmail.com>2011-02-10 16:51:30 +0100
commit1814298d7590988d354955efdb0bc495b359293b (patch)
tree8592b94b8ba65f2b325466ef933cb4dc7950b9f8 /activesupport/test
parent89a5f1463d7e9546ed7a0cf482afea99ba2040e7 (diff)
downloadrails-1814298d7590988d354955efdb0bc495b359293b.tar.gz
rails-1814298d7590988d354955efdb0bc495b359293b.tar.bz2
rails-1814298d7590988d354955efdb0bc495b359293b.zip
Removed Array#safe_join in AS core_ext and moved it to a view helper with the same same. This also changes how safe_join works, if items or the separator are not html_safe they are html_escape'd, a html_safe string is always returned.
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/string_ext_test.rb44
1 files changed, 0 insertions, 44 deletions
diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb
index 15e39a06c3..bb865cae91 100644
--- a/activesupport/test/core_ext/string_ext_test.rb
+++ b/activesupport/test/core_ext/string_ext_test.rb
@@ -434,50 +434,6 @@ class OutputSafetyTest < ActiveSupport::TestCase
assert string.html_safe?
end
- test "Joining safe elements without a separator is safe" do
- array = 5.times.collect { "some string".html_safe }
- assert array.safe_join.html_safe?
- end
-
- test "Joining safe elements with a safe separator is safe" do
- array = 5.times.collect { "some string".html_safe }
- assert array.safe_join("-".html_safe).html_safe?
- end
-
- test "Joining safe elements with an unsafe separator is unsafe" do
- array = 5.times.collect { "some string".html_safe }
- assert !array.safe_join("-").html_safe?
- end
-
- test "Joining is unsafe if any element is unsafe even with a safe separator" do
- array = 5.times.collect { "some string".html_safe }
- array << "some string"
- assert !array.safe_join("-".html_safe).html_safe?
- end
-
- test "Joining is unsafe if any element is unsafe and no separator is given" do
- array = 5.times.collect { "some string".html_safe }
- array << "some string"
- assert !array.safe_join.html_safe?
- end
-
- test "Joining is unsafe if any element is unsafe and the separator is unsafe" do
- array = 5.times.collect { "some string".html_safe }
- array << "some string"
- assert !array.safe_join("-").html_safe?
- end
-
- test "Array is safe if all elements are safe" do
- array = 5.times.collect { "some string".html_safe }
- assert array.html_safe?
- end
-
- test "Array is unsafe if any element is unsafe" do
- array = 5.times.collect { "some string".html_safe }
- array << "some string"
- assert !array.html_safe?
- end
-
test 'emits normal string yaml' do
assert_equal 'foo'.to_yaml, 'foo'.html_safe.to_yaml(:foo => 1)
end