diff options
Diffstat (limited to 'railties/test/plugins')
-rw-r--r-- | railties/test/plugins/vendored_test.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/railties/test/plugins/vendored_test.rb b/railties/test/plugins/vendored_test.rb index 86f3ecd1f7..05c01846e1 100644 --- a/railties/test/plugins/vendored_test.rb +++ b/railties/test/plugins/vendored_test.rb @@ -221,6 +221,24 @@ YAML assert_equal "1", I18n.t(:bar) end + test "plugin metals are added to the middleware stack" do + @plugin.write 'app/metal/foo_metal.rb', <<-RUBY + class FooMetal + def self.call(env) + [200, { "Content-Type" => "text/html"}, ["FooMetal"]] + end + end + RUBY + + boot_rails + require 'rack/test' + extend Rack::Test::Methods + + get "/" + assert_equal 200, last_response.status + assert_equal "FooMetal", last_response.body + end + test "namespaced controllers with namespaced routes" do @plugin.write "config/routes.rb", <<-RUBY ActionController::Routing::Routes.draw do @@ -248,6 +266,16 @@ YAML assert_equal "Rendered from namespace", last_response.body end + test "plugin with initializers" do + $plugin_initializer = false + @plugin.write "config/initializers/foo.rb", <<-RUBY + $plugin_initializer = true + RUBY + + boot_rails + assert $plugin_initializer + end + test "plugin cannot declare an engine for it" do @plugin.write "lib/bukkits.rb", <<-RUBY class Bukkits |