diff options
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/rails_model_subclass_generator_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/test/generators/rails_model_subclass_generator_test.rb b/railties/test/generators/rails_model_subclass_generator_test.rb new file mode 100644 index 0000000000..30066b5a3c --- /dev/null +++ b/railties/test/generators/rails_model_subclass_generator_test.rb @@ -0,0 +1,15 @@ +require 'generators/generator_test_helper' + +class RailsModelSubclassGeneratorTest < GeneratorTestCase + + def test_model_subclass_generates_resources + run_generator('model_subclass', %w(Car Product)) + + assert_generated_model_for :car, "Product" + assert_generated_unit_test_for :car + end + + def test_model_subclass_must_have_a_parent_class_name + assert_raise(Rails::Generator::UsageError) { run_generator('model_subclass', %w(Car)) } + end +end
\ No newline at end of file |