Permalink
Browse files

Added regression tests

  • Loading branch information...
1 parent 4021639 commit 1a06530aa50e1aed5c7dff6f1256abb555c497b6 Stefan Sprenger committed Jun 7, 2011
Showing with 5 additions and 12 deletions.
  1. +5 −12 railties/test/railties/generators_test.rb
@@ -1,16 +1,6 @@
-require 'fileutils'
+RAILS_ISOLATION_COMMAND = "engine"
+require "isolation/abstract_unit"
-require 'test/unit'
-require 'rubygems'
-
-# TODO: Remove setting this magic constant
-RAILS_FRAMEWORK_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../..")
-
-# These files do not require any others and are needed
-# to run the tests
-require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/testing/isolation"
-require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/testing/declarative"
-require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/core_ext/kernel/reporting"
require "#{RAILS_FRAMEWORK_ROOT}/railties/lib/rails/generators/test_case"
module RailtiesTests
@@ -70,20 +60,23 @@ def test_controllers_are_correctly_namespaced
Dir.chdir(engine_path) do
bundled_rails("g controller topics")
assert_file "app/controllers/foo_bar/topics_controller.rb", /FooBar::TopicsController/
+ assert_no_file "app/controllers/topics_controller.rb"
end
end
def test_models_are_correctly_namespaced
Dir.chdir(engine_path) do
bundled_rails("g model topic")
assert_file "app/models/foo_bar/topic.rb", /FooBar::Topic/
+ assert_no_file "app/models/topic.rb"
end
end
def test_helpers_are_correctly_namespaced
Dir.chdir(engine_path) do
bundled_rails("g helper topics")
assert_file "app/helpers/foo_bar/topics_helper.rb", /FooBar::TopicsHelper/
+ assert_no_file "app/helpers/topics_helper.rb"
end
end
end

0 comments on commit 1a06530

Please sign in to comment.