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'
Rake::TestTask.new(:action_pack) do |t|
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.verbose = true
end

View File

@ -2,7 +2,7 @@ require 'abstract_unit'
require 'active_support/logger'
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_path; "test"; end

View File

@ -9,7 +9,7 @@ old_load_paths = ActionController::Base.view_paths
ActionView::Template::register_template_handler :mab,
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
def self.controller_path; 'views' end
@ -87,7 +87,7 @@ class StreamingLayoutController < LayoutTest
end
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
class HasOwnLayoutController < LayoutTest
@ -108,7 +108,7 @@ end
class PrependsViewPathController < LayoutTest
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'
end
end

View File

@ -88,7 +88,7 @@ class TestController < ApplicationController
end
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
# :ported:
@ -157,14 +157,14 @@ class TestController < ApplicationController
# :ported:
def render_file_with_instance_variables
@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
end
# :ported:
def render_file_as_string_with_instance_variables
@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
end
@ -181,21 +181,21 @@ class TestController < ApplicationController
def render_file_using_pathname
@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
def render_file_from_template
@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
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'}
end
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'}
end