From 95c517b6d6c13bfff2a020b2a29ec5c9bacfebf3 Mon Sep 17 00:00:00 2001 From: Timm Date: Fri, 2 Aug 2013 17:01:54 +0200 Subject: Moved Dom and Selector assertions from ActionDispatch to ActionView. --- actionpack/lib/action_controller/test_case.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/lib/action_controller/test_case.rb') diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index e6695ffc90..89176736c8 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -673,6 +673,7 @@ module ActionController included do include ActionController::TemplateAssertions include ActionDispatch::Assertions + include ActionView::Assertions class_attribute :_controller_class setup :setup_controller_request_and_response end -- cgit v1.2.3 From 748f28157bfd9e26fe213bed4aed6c2c578921ba Mon Sep 17 00:00:00 2001 From: Timm Date: Wed, 7 Aug 2013 16:42:17 +0200 Subject: Require ActionView::Assertions in ActionController test_case.rb. --- actionpack/lib/action_controller/test_case.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/lib/action_controller/test_case.rb') diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 89176736c8..0a728aa7c0 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -2,6 +2,7 @@ require 'rack/session/abstract/id' require 'active_support/core_ext/object/to_query' require 'active_support/core_ext/module/anonymous' require 'active_support/core_ext/hash/keys' +require 'action_view/testing/assertions' module ActionController module TemplateAssertions -- cgit v1.2.3 From a766a025e61c6ad43c113c7fbaca0adbb7841564 Mon Sep 17 00:00:00 2001 From: Timm Date: Tue, 24 Sep 2013 19:09:22 +0200 Subject: Moved ActionView::Assertions dependency from Action Pack's lib to abstract_unit.rb. --- actionpack/lib/action_controller/test_case.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'actionpack/lib/action_controller/test_case.rb') diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 0a728aa7c0..e6695ffc90 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -2,7 +2,6 @@ require 'rack/session/abstract/id' require 'active_support/core_ext/object/to_query' require 'active_support/core_ext/module/anonymous' require 'active_support/core_ext/hash/keys' -require 'action_view/testing/assertions' module ActionController module TemplateAssertions @@ -674,7 +673,6 @@ module ActionController included do include ActionController::TemplateAssertions include ActionDispatch::Assertions - include ActionView::Assertions class_attribute :_controller_class setup :setup_controller_request_and_response end -- cgit v1.2.3 From 83f1563ee6cae34447b4ed12f8cf39cc15177a38 Mon Sep 17 00:00:00 2001 From: Timm Date: Fri, 11 Oct 2013 23:29:08 +0200 Subject: Support for changes in SelectorAssertions. --- actionpack/lib/action_controller/test_case.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'actionpack/lib/action_controller/test_case.rb') diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index e6695ffc90..98ed1c2382 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -3,6 +3,9 @@ require 'active_support/core_ext/object/to_query' require 'active_support/core_ext/module/anonymous' require 'active_support/core_ext/hash/keys' +require 'loofah' +require 'rails-dom-testing' + module ActionController module TemplateAssertions extend ActiveSupport::Concern @@ -432,6 +435,7 @@ module ActionController extend ActiveSupport::Concern include ActionDispatch::TestProcess include ActiveSupport::Testing::ConstantLookup + include Rails::Dom::Testing::Assertions attr_reader :response, :request @@ -678,6 +682,16 @@ module ActionController end private + + def document_root_element + @html_document ||= if @response.content_type =~ /xml$/ + Loofah.xml_document(@response.body) + else + Loofah.document(@response.body) + end.root + end + + def check_required_ivars # Sanity check for required instance variables so we can give an # understandable error message. -- cgit v1.2.3 From 9efdffe437ef5ac7b4416a9b7ad180b1e5888e28 Mon Sep 17 00:00:00 2001 From: Timm Date: Sat, 12 Oct 2013 22:58:51 +0200 Subject: Moved html_document to ActionDispatch::Assertions. Included the Rails::Dom::Testing::Assertions there as well. --- actionpack/lib/action_controller/test_case.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'actionpack/lib/action_controller/test_case.rb') diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 98ed1c2382..c307702f5d 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -684,14 +684,9 @@ module ActionController private def document_root_element - @html_document ||= if @response.content_type =~ /xml$/ - Loofah.xml_document(@response.body) - else - Loofah.document(@response.body) - end.root + html_document.root end - def check_required_ivars # Sanity check for required instance variables so we can give an # understandable error message. -- cgit v1.2.3