aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-09-11 03:24:50 -0500
committerwycats <wycats@gmail.com>2010-09-11 03:24:50 -0500
commitf6153f74da29f56017d5ddb8a2b8869d9b5835d7 (patch)
tree39de2f1a37cc755ed0e0950c012b47c61427bf83 /railties/test
parent477df63433d8543ae8568de149e70d1bf1b41bb8 (diff)
parent497b6af8818f656fdbca9ed2470c1c16ae5ff1cd (diff)
downloadrails-f6153f74da29f56017d5ddb8a2b8869d9b5835d7.tar.gz
rails-f6153f74da29f56017d5ddb8a2b8869d9b5835d7.tar.bz2
rails-f6153f74da29f56017d5ddb8a2b8869d9b5835d7.zip
Merge remote branch 'drogus/engines'
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/initializers/frameworks_test.rb2
-rw-r--r--railties/test/application/routing_test.rb2
-rw-r--r--railties/test/railties/engine_test.rb30
-rw-r--r--railties/test/railties/mounted_engine_test.rb4
4 files changed, 33 insertions, 5 deletions
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb
index 61340e82c3..6970ea7b7a 100644
--- a/railties/test/application/initializers/frameworks_test.rb
+++ b/railties/test/application/initializers/frameworks_test.rb
@@ -61,7 +61,7 @@ module ApplicationTests
require "#{app_path}/config/environment"
assert Foo.method_defined?(:foo_path)
- assert Foo.method_defined?(:app)
+ assert Foo.method_defined?(:main_app)
assert_equal ["notify"], Foo.action_methods
end
diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb
index d0c6cb51ca..b4ff14409f 100644
--- a/railties/test/application/routing_test.rb
+++ b/railties/test/application/routing_test.rb
@@ -203,7 +203,7 @@ module ApplicationTests
assert_equal 'bar', last_response.body
app_file 'config/routes.rb', <<-RUBY
- AppTemplate::Application.routes.draw do |map|
+ AppTemplate::Application.routes.draw do
match 'foo', :to => 'foo#baz'
end
RUBY
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb
index fabd561bd2..6fc166e054 100644
--- a/railties/test/railties/engine_test.rb
+++ b/railties/test/railties/engine_test.rb
@@ -281,6 +281,34 @@ module RailtiesTest
assert_equal expected, stripped_body
end
+ test "default application's asset_path" do
+ @plugin.write "config/routes.rb", <<-RUBY
+ Bukkits::Engine.routes.draw do
+ match "/foo" => "foo#index"
+ end
+ RUBY
+
+ @plugin.write "app/controllers/foo_controller.rb", <<-RUBY
+ class FooController < ActionController::Base
+ def index
+ end
+ end
+ RUBY
+
+ @plugin.write "app/views/foo/index.html.erb", <<-RUBY
+ <%= compute_public_path("/foo", "") %>
+ RUBY
+
+ boot_rails
+
+ env = Rack::MockRequest.env_for("/foo")
+ response = Bukkits::Engine.call(env)
+ stripped_body = response[2].body.strip
+
+ expected = "/bukkits/foo"
+ assert_equal expected, stripped_body
+ end
+
test "engine's files are served via ActionDispatch::Static" do
add_to_config "config.serve_static_assets = true"
@@ -437,7 +465,7 @@ module RailtiesTest
end
def routes_helpers_in_view
- render :inline => "<%= foo_path %>, <%= app.bar_path %>"
+ render :inline => "<%= foo_path %>, <%= main_app.bar_path %>"
end
def polymorphic_path_without_namespace
diff --git a/railties/test/railties/mounted_engine_test.rb b/railties/test/railties/mounted_engine_test.rb
index 73b7e5b2e0..b52ced92ec 100644
--- a/railties/test/railties/mounted_engine_test.rb
+++ b/railties/test/railties/mounted_engine_test.rb
@@ -70,14 +70,14 @@ module ApplicationTests
end
def generate_application_route
- path = app.url_for(:controller => "/main",
+ path = main_app.url_for(:controller => "/main",
:action => "index",
:only_path => true)
render :text => path
end
def application_route_in_view
- render :inline => "<%= app.root_path %>"
+ render :inline => "<%= main_app.root_path %>"
end
end
end