diff options
author | Rafael Mendonça França <rafael.franca@plataformatec.com.br> | 2014-09-01 22:46:05 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafael.franca@plataformatec.com.br> | 2014-09-01 22:46:05 -0300 |
commit | c6f9cec1bee6b722088119ae14c71a32c1eed914 (patch) | |
tree | 7a2c865b7b0fb72a6cde4a4d098bd4ab37b25b7e /railties | |
parent | 5c057f925516e87b2bcd6701fab42c1454652cc3 (diff) | |
download | rails-c6f9cec1bee6b722088119ae14c71a32c1eed914.tar.gz rails-c6f9cec1bee6b722088119ae14c71a32c1eed914.tar.bz2 rails-c6f9cec1bee6b722088119ae14c71a32c1eed914.zip |
Add test to assert the right sanitizer vendor is being used
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/default_stack_test.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/railties/test/application/default_stack_test.rb b/railties/test/application/default_stack_test.rb new file mode 100644 index 0000000000..4778cdd74c --- /dev/null +++ b/railties/test/application/default_stack_test.rb @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +require 'isolation/abstract_unit' +require 'rack/test' +require 'active_support/json' + +module ApplicationTests + class DefaultStackTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + include Rack::Test::Methods + + def setup + build_app(initializers: true) + boot_rails + end + + def teardown + teardown_app + end + + test "the sanitizer helper" do + controller :foo, <<-RUBY + class FooController < ApplicationController + def index + render text: self.class.helpers.class.sanitizer_vendor + end + end + RUBY + + app_file 'config/routes.rb', <<-RUBY + Rails.application.routes.draw do + get ':controller(/:action)' + end + RUBY + + require "#{app_path}/config/environment" + + get "/foo" + assert_equal 'Rails::Html::Sanitizer', last_response.body.strip + end + end +end |