Move actionpack's controller tests

This commit is contained in:
Łukasz Strzałkowski 2013-08-13 22:28:51 +02:00
parent 34a2e486d6
commit 7620ab08be
4 changed files with 12 additions and 12 deletions

View File

@ -35,7 +35,7 @@ namespace :test do
desc 'ActionPack Integration Tests' desc 'ActionPack Integration Tests'
Rake::TestTask.new(:action_pack) do |t| Rake::TestTask.new(:action_pack) do |t|
t.libs << 'test' t.libs << 'test'
t.test_files = Dir.glob("test/actionpack/*_test.rb") t.test_files = Dir.glob("test/actionpack/**/*_test.rb")
t.warning = true t.warning = true
t.verbose = true t.verbose = true
end end

View File

@ -2,7 +2,7 @@ require 'abstract_unit'
require 'active_support/logger' require 'active_support/logger'
class CaptureController < ActionController::Base class CaptureController < ActionController::Base
self.view_paths = [ File.dirname(__FILE__) + '/../fixtures/actionpack/' ] self.view_paths = [ File.dirname(__FILE__) + '/../../fixtures/actionpack' ]
def self.controller_name; "test"; end def self.controller_name; "test"; end
def self.controller_path; "test"; end def self.controller_path; "test"; end

View File

@ -9,7 +9,7 @@ old_load_paths = ActionController::Base.view_paths
ActionView::Template::register_template_handler :mab, ActionView::Template::register_template_handler :mab,
lambda { |template| template.source.inspect } lambda { |template| template.source.inspect }
ActionController::Base.view_paths = [ File.dirname(__FILE__) + '/../fixtures/actionpack/layout_tests/' ] ActionController::Base.view_paths = [ File.dirname(__FILE__) + '/../../fixtures/actionpack/layout_tests/' ]
class LayoutTest < ActionController::Base class LayoutTest < ActionController::Base
def self.controller_path; 'views' end def self.controller_path; 'views' end
@ -87,7 +87,7 @@ class StreamingLayoutController < LayoutTest
end end
class AbsolutePathLayoutController < LayoutTest class AbsolutePathLayoutController < LayoutTest
layout File.expand_path(File.expand_path(__FILE__) + '/../../fixtures/actionpack/layout_tests/layouts/layout_test') layout File.expand_path(File.expand_path(__FILE__) + '/../../../fixtures/actionpack/layout_tests/layouts/layout_test')
end end
class HasOwnLayoutController < LayoutTest class HasOwnLayoutController < LayoutTest
@ -108,7 +108,7 @@ end
class PrependsViewPathController < LayoutTest class PrependsViewPathController < LayoutTest
def hello def hello
prepend_view_path File.dirname(__FILE__) + '/../fixtures/actionpack/layout_tests/alt/' prepend_view_path File.dirname(__FILE__) + '/../../fixtures/actionpack/layout_tests/alt/'
render :layout => 'alt' render :layout => 'alt'
end end
end end

View File

@ -88,7 +88,7 @@ class TestController < ApplicationController
end end
def hello_world_file def hello_world_file
render :file => File.expand_path("../../fixtures/actionpack/hello", __FILE__), :formats => [:html] render :file => File.expand_path("../../../fixtures/actionpack/hello", __FILE__), :formats => [:html]
end end
# :ported: # :ported:
@ -157,14 +157,14 @@ class TestController < ApplicationController
# :ported: # :ported:
def render_file_with_instance_variables def render_file_with_instance_variables
@secret = 'in the sauce' @secret = 'in the sauce'
path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar') path = File.join(File.dirname(__FILE__), '../../fixtures/test/render_file_with_ivar')
render :file => path render :file => path
end end
# :ported: # :ported:
def render_file_as_string_with_instance_variables def render_file_as_string_with_instance_variables
@secret = 'in the sauce' @secret = 'in the sauce'
path = File.expand_path(File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar')) path = File.expand_path(File.join(File.dirname(__FILE__), '../../fixtures/test/render_file_with_ivar'))
render path render path
end end
@ -181,21 +181,21 @@ class TestController < ApplicationController
def render_file_using_pathname def render_file_using_pathname
@secret = 'in the sauce' @secret = 'in the sauce'
render :file => Pathname.new(File.dirname(__FILE__)).join('..', 'fixtures', 'test', 'dot.directory', 'render_file_with_ivar') render :file => Pathname.new(File.dirname(__FILE__)).join('..', '..', 'fixtures', 'test', 'dot.directory', 'render_file_with_ivar')
end end
def render_file_from_template def render_file_from_template
@secret = 'in the sauce' @secret = 'in the sauce'
@path = File.expand_path(File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar')) @path = File.expand_path(File.join(File.dirname(__FILE__), '../../fixtures/test/render_file_with_ivar'))
end end
def render_file_with_locals def render_file_with_locals
path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_locals') path = File.join(File.dirname(__FILE__), '../../fixtures/test/render_file_with_locals')
render :file => path, :locals => {:secret => 'in the sauce'} render :file => path, :locals => {:secret => 'in the sauce'}
end end
def render_file_as_string_with_locals def render_file_as_string_with_locals
path = File.expand_path(File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_locals')) path = File.expand_path(File.join(File.dirname(__FILE__), '../../fixtures/test/render_file_with_locals'))
render path, :locals => {:secret => 'in the sauce'} render path, :locals => {:secret => 'in the sauce'}
end end