aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorWojciech Wnętrzak <w.wnetrzak@gmail.com>2012-07-06 21:22:14 +0200
committerWojciech Wnętrzak <w.wnetrzak@gmail.com>2012-07-06 21:22:14 +0200
commitf874b155611a837c97be80dd02681ab4c3c0a63e (patch)
tree0bf925fb7d1c96b248935297582cfb2a908ec227 /railties
parent717aa92dd3f75dec04652940d5571ab34a2f79c3 (diff)
downloadrails-f874b155611a837c97be80dd02681ab4c3c0a63e.tar.gz
rails-f874b155611a837c97be80dd02681ab4c3c0a63e.tar.bz2
rails-f874b155611a837c97be80dd02681ab4c3c0a63e.zip
Added failing test for generating namespaced table_name_prefix in engines
Diffstat (limited to 'railties')
-rw-r--r--railties/test/railties/generators_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/test/railties/generators_test.rb b/railties/test/railties/generators_test.rb
index 1938bfb6c2..c90b795d59 100644
--- a/railties/test/railties/generators_test.rb
+++ b/railties/test/railties/generators_test.rb
@@ -75,6 +75,18 @@ module RailtiesTests
end
end
+ def test_table_name_prefix_is_correctly_namespaced_when_engine_is_mountable
+ build_mountable_engine
+ Dir.chdir(engine_path) do
+ bundled_rails("g model namespaced/topic")
+ assert_file "app/models/foo_bar/namespaced.rb", /module FooBar\n module Namespaced/ do |content|
+ assert_class_method :table_name_prefix, content do |method_content|
+ assert_match(/'foo_bar_namespaced_'/, method_content)
+ end
+ end
+ end
+ end
+
def test_helpers_are_correctly_namespaced_when_engine_is_mountable
build_mountable_engine
Dir.chdir(engine_path) do