Skip to content

Commit

Permalink
Added failing test for generating namespaced table_name_prefix in eng…
Browse files Browse the repository at this point in the history
…ines
  • Loading branch information
morgoth committed Jul 6, 2012
1 parent 717aa92 commit f874b15
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions railties/test/railties/generators_test.rb
Expand Up @@ -75,6 +75,18 @@ def test_models_are_correctly_namespaced_when_engine_is_mountable
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
Expand Down

0 comments on commit f874b15

Please sign in to comment.