From 13dd7758cedf6152835c4c72b69b1fe631a60733 Mon Sep 17 00:00:00 2001 From: Damien Mathieu <42@dmathieu.com> Date: Tue, 23 Aug 2011 11:02:44 +0200 Subject: remove useless rescue params is a method, defined in every controller, which always returns a hash. If it raises a NoMethodError, it means there's a bug somewhere else, which we want to know about. --- actionpack/test/abstract_unit.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack/test/abstract_unit.rb') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 24d071df39..aa7a01f6c9 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -142,7 +142,11 @@ class RoutedRackApp end class BasicController - attr_accessor :request + attr_accessor :request, :params + + def initialize + @params = {} + end def config @config ||= ActiveSupport::InheritableOptions.new(ActionController::Base.config).tap do |config| -- cgit v1.2.3 From e5f2b0d75f29cd7d9e11e8008d410caf48ab1078 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 30 Aug 2011 20:47:01 -0300 Subject: Revert "Merge pull request #2647 from dmathieu/no_rescue" This reverts commit 125b1b0b9180ec8f0135da185e77250d2b8a4bea. --- actionpack/test/abstract_unit.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'actionpack/test/abstract_unit.rb') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index aa7a01f6c9..24d071df39 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -142,11 +142,7 @@ class RoutedRackApp end class BasicController - attr_accessor :request, :params - - def initialize - @params = {} - end + attr_accessor :request def config @config ||= ActiveSupport::InheritableOptions.new(ActionController::Base.config).tap do |config| -- cgit v1.2.3 From cd9d28d6fdff6819dac3c6643fe882eb568b5a39 Mon Sep 17 00:00:00 2001 From: lest Date: Thu, 24 Nov 2011 22:37:48 +0300 Subject: middlewares should use logger from env --- actionpack/test/abstract_unit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/test/abstract_unit.rb') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 24d071df39..cbb8968496 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -333,9 +333,9 @@ module ActionDispatch "#{FIXTURE_LOAD_PATH}/public" end - remove_method :logger + remove_method :stderr_logger # Silence logger - def logger + def stderr_logger nil end end -- cgit v1.2.3 From e975fe710a1a78d723cfd91c07014627f92e3250 Mon Sep 17 00:00:00 2001 From: lest Date: Wed, 30 Nov 2011 17:38:09 +0300 Subject: test helpers in erb using erb --- actionpack/test/abstract_unit.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/test/abstract_unit.rb') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index cbb8968496..644422a6a8 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -73,6 +73,14 @@ module RackTestUtils end module RenderERBUtils + def view + @view ||= begin + path = ActionView::FileSystemResolver.new(FIXTURE_LOAD_PATH) + view_paths = ActionView::PathSet.new([path]) + ActionView::Base.new(view_paths) + end + end + def render_erb(string) template = ActionView::Template.new( string.strip, -- cgit v1.2.3 From a985309abc8993ddc33c7a604bc41868909f457c Mon Sep 17 00:00:00 2001 From: lest Date: Wed, 30 Nov 2011 18:05:23 +0300 Subject: fix warning in tests when using render_erb helper --- actionpack/test/abstract_unit.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionpack/test/abstract_unit.rb') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 644422a6a8..680d562379 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -82,6 +82,8 @@ module RenderERBUtils end def render_erb(string) + @virtual_path = nil + template = ActionView::Template.new( string.strip, "test template", -- cgit v1.2.3 From 565d92f57891c1114801a27cf45ba8ee4ec02cf9 Mon Sep 17 00:00:00 2001 From: lest Date: Wed, 30 Nov 2011 18:34:16 +0300 Subject: fix method redefined warnings in tests --- actionpack/test/abstract_unit.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack/test/abstract_unit.rb') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 680d562379..d191a203dd 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -351,3 +351,8 @@ module ActionDispatch end end +module RoutingTestHelpers + def url_for(set, options, recall = nil) + set.send(:url_for, options.merge(:only_path => true, :_path_segments => recall)) + end +end -- cgit v1.2.3