1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Added failing test for generating namespaced table_name_prefix in engines

This commit is contained in:
Wojciech Wnętrzak 2012-07-06 21:22:14 +02:00
parent 717aa92dd3
commit f874b15561

View file

@ -75,6 +75,18 @@ module RailtiesTests
end end
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 def test_helpers_are_correctly_namespaced_when_engine_is_mountable
build_mountable_engine build_mountable_engine
Dir.chdir(engine_path) do Dir.chdir(engine_path) do