aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-11-17 16:37:17 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-11-17 16:37:17 -0200
commit5b7b98d5904e9f01f13b783f1a692a1c11168b2d (patch)
tree0fd337f9d6c5b17620da476d1dd4cc3d1858dd47
parented8dc23e8e8ab7d010eb86658db7834a2089708e (diff)
downloadrails-5b7b98d5904e9f01f13b783f1a692a1c11168b2d.tar.gz
rails-5b7b98d5904e9f01f13b783f1a692a1c11168b2d.tar.bz2
rails-5b7b98d5904e9f01f13b783f1a692a1c11168b2d.zip
document_root_element need to be public
-rw-r--r--Gemfile1
-rw-r--r--actionpack/lib/action_controller/test_case.rb8
-rw-r--r--actionview/lib/action_view/test_case.rb10
3 files changed, 10 insertions, 9 deletions
diff --git a/Gemfile b/Gemfile
index e7b7913970..0705a21046 100644
--- a/Gemfile
+++ b/Gemfile
@@ -15,6 +15,7 @@ gem 'jquery-rails', '~> 4.0.0.beta2'
gem 'coffee-rails', '~> 4.1.0'
gem 'turbolinks'
gem 'arel', github: 'rails/arel'
+gem 'rails-dom-testing', path: '~/src/rails/rails-dom-testing'
# require: false so bcrypt is loaded only when has_secure_password is used.
# This is to avoid ActiveModel (and by extension the entire framework)
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index aa475dc4c4..097019144c 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -679,6 +679,10 @@ module ActionController
klass.new
end
+ def document_root_element
+ html_document
+ end
+
included do
include ActionController::TemplateAssertions
include ActionDispatch::Assertions
@@ -688,10 +692,6 @@ module ActionController
private
- def document_root_element
- html_document
- end
-
def check_required_ivars
# Sanity check for required instance variables so we can give an
# understandable error message.
diff --git a/actionview/lib/action_view/test_case.rb b/actionview/lib/action_view/test_case.rb
index fec980462d..5cffddcd4f 100644
--- a/actionview/lib/action_view/test_case.rb
+++ b/actionview/lib/action_view/test_case.rb
@@ -125,6 +125,11 @@ module ActionView
@_rendered_views ||= RenderedViewsCollection.new
end
+ # Need to experiment if this priority is the best one: rendered => output_buffer
+ def document_root_element
+ Nokogiri::HTML::DocumentFragment.parse(@rendered.blank? ? @output_buffer : @rendered)
+ end
+
class RenderedViewsCollection
def initialize
@rendered_views ||= Hash.new { |hash, key| hash[key] = [] }
@@ -156,11 +161,6 @@ module ActionView
private
- # Need to experiment if this priority is the best one: rendered => output_buffer
- def document_root_element
- Nokogiri::HTML::DocumentFragment.parse(@rendered.blank? ? @output_buffer : @rendered)
- end
-
def say_no_to_protect_against_forgery!
_helpers.module_eval do
remove_possible_method :protect_against_forgery?