aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-07-12 14:11:51 -0500
committerJoshua Peek <josh@joshpeek.com>2008-07-12 14:11:51 -0500
commit30204c4e66cea989c4ee48b52c8827c79e98f14a (patch)
tree67732754c6a7deb6d2efbcaae0a9b3ba60ff8920 /actionpack/test
parent65fb2e76f2c4571b04458c7bf6a0c815972232ab (diff)
downloadrails-30204c4e66cea989c4ee48b52c8827c79e98f14a.tar.gz
rails-30204c4e66cea989c4ee48b52c8827c79e98f14a.tar.bz2
rails-30204c4e66cea989c4ee48b52c8827c79e98f14a.zip
Set global ActionController::Base.view_paths for test cases
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/abstract_unit.rb4
-rw-r--r--actionpack/test/activerecord/render_partial_with_record_identification_test.rb8
-rw-r--r--actionpack/test/controller/action_pack_assertions_test.rb8
-rw-r--r--actionpack/test/controller/addresses_render_test.rb2
-rw-r--r--actionpack/test/controller/caching_test.rb3
-rw-r--r--actionpack/test/controller/capture_test.rb2
-rw-r--r--actionpack/test/controller/content_type_test.rb2
-rw-r--r--actionpack/test/controller/deprecation/deprecated_base_methods_test.rb2
-rw-r--r--actionpack/test/controller/mime_responds_test.rb2
-rw-r--r--actionpack/test/controller/new_render_test.rb3
-rw-r--r--actionpack/test/controller/render_test.rb3
-rw-r--r--actionpack/test/controller/send_file_test.rb2
-rw-r--r--actionpack/test/controller/view_paths_test.rb2
-rw-r--r--actionpack/test/template/render_test.rb2
-rw-r--r--actionpack/test/template/url_helper_test.rb8
15 files changed, 4 insertions, 49 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index 70f6a28a9c..0d2e0f273a 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -22,7 +22,9 @@ ActiveSupport::Deprecation.debug = true
ActionController::Base.logger = nil
ActionController::Routing::Routes.reload rescue nil
-FIXTURE_LOAD_PATH = ActionView::ViewLoadPaths::LoadPath.new(File.join(File.dirname(__FILE__), 'fixtures'))
+ActionView::Base.cache_template_loading = true
+FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')
+ActionController::Base.view_paths = FIXTURE_LOAD_PATH
# Wrap tests that use Mocha and skip if unavailable.
def uses_mocha(test_name)
diff --git a/actionpack/test/activerecord/render_partial_with_record_identification_test.rb b/actionpack/test/activerecord/render_partial_with_record_identification_test.rb
index a9d3ff040f..a82a1a3023 100644
--- a/actionpack/test/activerecord/render_partial_with_record_identification_test.rb
+++ b/actionpack/test/activerecord/render_partial_with_record_identification_test.rb
@@ -41,8 +41,6 @@ class RenderPartialWithRecordIdentificationController < ActionController::Base
end
end
-RenderPartialWithRecordIdentificationController.view_paths = [FIXTURE_LOAD_PATH]
-
class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase
fixtures :developers, :projects, :developers_projects, :topics, :replies, :companies, :mascots
@@ -123,8 +121,6 @@ class RenderPartialWithRecordIdentificationController < ActionController::Base
end
end
-RenderPartialWithRecordIdentificationController.view_paths = [FIXTURE_LOAD_PATH]
-
class Game < Struct.new(:name, :id)
def to_param
id.to_s
@@ -142,8 +138,6 @@ module Fun
end
end
- NestedController.view_paths = [FIXTURE_LOAD_PATH]
-
module Serious
class NestedDeeperController < ActionController::Base
def render_with_record_in_deeper_nested_controller
@@ -154,8 +148,6 @@ module Fun
render :partial => [ Game.new("Chess"), Game.new("Sudoku"), Game.new("Solitaire") ]
end
end
-
- NestedDeeperController.view_paths = [FIXTURE_LOAD_PATH]
end
end
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb
index f5cda99977..610e196362 100644
--- a/actionpack/test/controller/action_pack_assertions_test.rb
+++ b/actionpack/test/controller/action_pack_assertions_test.rb
@@ -164,14 +164,6 @@ module Admin
end
end
-# ---------------------------------------------------------------------------
-
-
-# tell the controller where to find its templates but start from parent
-# directory of test_request_response to simulate the behaviour of a
-# production environment
-ActionPackAssertionsController.view_paths = [FIXTURE_LOAD_PATH]
-
# a test case to exercise the new capabilities TestRequest & TestResponse
class ActionPackAssertionsControllerTest < Test::Unit::TestCase
# let's get this party started
diff --git a/actionpack/test/controller/addresses_render_test.rb b/actionpack/test/controller/addresses_render_test.rb
index df87182082..b26cae24fb 100644
--- a/actionpack/test/controller/addresses_render_test.rb
+++ b/actionpack/test/controller/addresses_render_test.rb
@@ -19,8 +19,6 @@ class AddressesTestController < ActionController::Base
def self.controller_path; "addresses"; end
end
-AddressesTestController.view_paths = [FIXTURE_LOAD_PATH]
-
class AddressesTest < Test::Unit::TestCase
def setup
@controller = AddressesTestController.new
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index 15db70e474..2e98837a35 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -6,7 +6,6 @@ CACHE_DIR = 'test_cache'
FILE_STORE_PATH = File.join(File.dirname(__FILE__), '/../temp/', CACHE_DIR)
ActionController::Base.page_cache_directory = FILE_STORE_PATH
ActionController::Base.cache_store = :file_store, FILE_STORE_PATH
-ActionController::Base.view_paths = [FIXTURE_LOAD_PATH]
class PageCachingTestController < ActionController::Base
caches_page :ok, :no_content, :if => Proc.new { |c| !c.request.format.json? }
@@ -636,8 +635,6 @@ class FunctionalCachingController < ActionController::Base
end
end
-FunctionalCachingController.view_paths = [FIXTURE_LOAD_PATH]
-
class FunctionalFragmentCachingTest < Test::Unit::TestCase
def setup
ActionController::Base.perform_caching = true
diff --git a/actionpack/test/controller/capture_test.rb b/actionpack/test/controller/capture_test.rb
index 87f9ce8ab3..5ded6a5d26 100644
--- a/actionpack/test/controller/capture_test.rb
+++ b/actionpack/test/controller/capture_test.rb
@@ -23,8 +23,6 @@ class CaptureController < ActionController::Base
def rescue_action(e) raise end
end
-CaptureController.view_paths = [FIXTURE_LOAD_PATH]
-
class CaptureTest < Test::Unit::TestCase
def setup
@controller = CaptureController.new
diff --git a/actionpack/test/controller/content_type_test.rb b/actionpack/test/controller/content_type_test.rb
index 33aa4e49ee..d457d13aef 100644
--- a/actionpack/test/controller/content_type_test.rb
+++ b/actionpack/test/controller/content_type_test.rb
@@ -45,8 +45,6 @@ class ContentTypeController < ActionController::Base
def rescue_action(e) raise end
end
-ContentTypeController.view_paths = [FIXTURE_LOAD_PATH]
-
class ContentTypeTest < Test::Unit::TestCase
def setup
@controller = ContentTypeController.new
diff --git a/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb b/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb
index f485500b7f..86555a77df 100644
--- a/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb
+++ b/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb
@@ -13,8 +13,6 @@ class DeprecatedBaseMethodsTest < Test::Unit::TestCase
def rescue_action(e) raise e end
end
- Target.view_paths = [FIXTURE_LOAD_PATH]
-
def setup
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb
index 17f5e27232..1701431858 100644
--- a/actionpack/test/controller/mime_responds_test.rb
+++ b/actionpack/test/controller/mime_responds_test.rb
@@ -162,8 +162,6 @@ class RespondToController < ActionController::Base
end
end
-RespondToController.view_paths = [FIXTURE_LOAD_PATH]
-
class MimeControllerTest < Test::Unit::TestCase
def setup
ActionController::Base.use_accept_header = true
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index b4dc2bb4dc..d2a3a2b0b0 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -465,9 +465,6 @@ class NewRenderTestController < ActionController::Base
end
end
-NewRenderTestController.view_paths = [FIXTURE_LOAD_PATH]
-Fun::GamesController.view_paths = [FIXTURE_LOAD_PATH]
-
class NewRenderTest < Test::Unit::TestCase
def setup
@controller = NewRenderTestController.new
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 10264dadaa..a857810b78 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -217,9 +217,6 @@ class TestController < ActionController::Base
end
end
-TestController.view_paths = [FIXTURE_LOAD_PATH]
-Fun::GamesController.view_paths = [FIXTURE_LOAD_PATH]
-
class RenderTest < Test::Unit::TestCase
def setup
@request = ActionController::TestRequest.new
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb
index ddec51d173..c003abf094 100644
--- a/actionpack/test/controller/send_file_test.rb
+++ b/actionpack/test/controller/send_file_test.rb
@@ -19,8 +19,6 @@ class SendFileController < ActionController::Base
def rescue_action(e) raise end
end
-SendFileController.view_paths = [FIXTURE_LOAD_PATH]
-
class SendFileTest < Test::Unit::TestCase
include TestFileUtils
diff --git a/actionpack/test/controller/view_paths_test.rb b/actionpack/test/controller/view_paths_test.rb
index b1c19384aa..85fa58a45b 100644
--- a/actionpack/test/controller/view_paths_test.rb
+++ b/actionpack/test/controller/view_paths_test.rb
@@ -1,8 +1,6 @@
require 'abstract_unit'
class ViewLoadPathsTest < Test::Unit::TestCase
- ActionController::Base.view_paths = [FIXTURE_LOAD_PATH]
-
class TestController < ActionController::Base
def self.controller_path() "test" end
def rescue_action(e) raise end
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb
index cd004a9f6d..cc5b4900dc 100644
--- a/actionpack/test/template/render_test.rb
+++ b/actionpack/test/template/render_test.rb
@@ -4,7 +4,7 @@ require 'controller/fake_models'
class ViewRenderTest < Test::Unit::TestCase
def setup
@assigns = { :secret => 'in the sauce' }
- @view = ActionView::Base.new([FIXTURE_LOAD_PATH], @assigns)
+ @view = ActionView::Base.new(ActionController::Base.view_paths, @assigns)
end
def test_render_file
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index 4ed5bc372f..91d5c6ffb5 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -302,8 +302,6 @@ end
class UrlHelperWithControllerTest < ActionView::TestCase
class UrlHelperController < ActionController::Base
- self.view_paths = [FIXTURE_LOAD_PATH]
-
def self.controller_path; 'url_helper_with_controller' end
def show_url_for
@@ -366,8 +364,6 @@ end
class LinkToUnlessCurrentWithControllerTest < ActionView::TestCase
class TasksController < ActionController::Base
- self.view_paths = [FIXTURE_LOAD_PATH]
-
def self.controller_path; 'tasks' end
def index
@@ -458,8 +454,6 @@ end
class PolymorphicControllerTest < ActionView::TestCase
class WorkshopsController < ActionController::Base
- self.view_paths = [FIXTURE_LOAD_PATH]
-
def self.controller_path; 'workshops' end
def index
@@ -476,8 +470,6 @@ class PolymorphicControllerTest < ActionView::TestCase
end
class SessionsController < ActionController::Base
- self.view_paths = [FIXTURE_LOAD_PATH]
-
def self.controller_path; 'sessions' end
def index