diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2015-03-14 17:53:24 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2015-03-14 17:53:24 -0300 |
commit | 5f6dab2270ef11081b2ceb70c630910cf071eede (patch) | |
tree | ee14abd9ce7f93492f85d95fbaa4efd15ceddc76 /actionview/test/abstract_unit.rb | |
parent | 335b81413b1dec17f36ef0b3d41a58b29220254f (diff) | |
parent | 56a7f156afface0731483b673afb72d17c81875c (diff) | |
download | rails-5f6dab2270ef11081b2ceb70c630910cf071eede.tar.gz rails-5f6dab2270ef11081b2ceb70c630910cf071eede.tar.bz2 rails-5f6dab2270ef11081b2ceb70c630910cf071eede.zip |
Merge pull request #19336 from tchandy/cleaning_actionview_tests
Cleaning actionview tests
Diffstat (limited to 'actionview/test/abstract_unit.rb')
-rw-r--r-- | actionview/test/abstract_unit.rb | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/actionview/test/abstract_unit.rb b/actionview/test/abstract_unit.rb index 3eded74f1b..4635c645d0 100644 --- a/actionview/test/abstract_unit.rb +++ b/actionview/test/abstract_unit.rb @@ -49,20 +49,6 @@ I18n.backend.store_translations 'pt-BR', {} ORIGINAL_LOCALES = I18n.available_locales.map(&:to_s).sort FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures') -FIXTURES = Pathname.new(FIXTURE_LOAD_PATH) - -module RackTestUtils - def body_to_string(body) - if body.respond_to?(:each) - str = "" - body.each {|s| str << s } - str - else - body - end - end - extend self -end module RenderERBUtils def view @@ -225,49 +211,6 @@ class ActionDispatch::IntegrationTest < ActiveSupport::TestCase end end -# Temporary base class -class Rack::TestCase < ActionDispatch::IntegrationTest - def self.testing(klass = nil) - if klass - @testing = "/#{klass.name.underscore}".sub!(/_controller$/, '') - else - @testing - end - end - - def get(thing, *args) - if thing.is_a?(Symbol) - super("#{self.class.testing}/#{thing}", *args) - else - super - end - end - - def assert_body(body) - assert_equal body, Array(response.body).join - end - - def assert_status(code) - assert_equal code, response.status - end - - def assert_response(body, status = 200, headers = {}) - assert_body body - assert_status status - headers.each do |header, value| - assert_header header, value - end - end - - def assert_content_type(type) - assert_equal type, response.headers["Content-Type"] - end - - def assert_header(name, value) - assert_equal value, response.headers[name] - end -end - ActionView::RoutingUrlFor.include(ActionDispatch::Routing::UrlFor) module ActionController |