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

Refactor generators tests to include test helpers in the parent class

This commit is contained in:
Carlos Antonio da Silva 2012-11-27 00:07:05 -02:00
parent fe4571259d
commit 8df46eac76

View file

@ -6,13 +6,15 @@ require 'rails/generators/mailer/mailer_generator'
require 'rails/generators/rails/scaffold/scaffold_generator'
class NamespacedGeneratorTestCase < Rails::Generators::TestCase
include GeneratorsTestHelper
def setup
super
Rails::Generators.namespace = TestApp
end
end
class NamespacedControllerGeneratorTest < NamespacedGeneratorTestCase
include GeneratorsTestHelper
arguments %w(Account foo bar)
tests Rails::Generators::ControllerGenerator
@ -81,7 +83,6 @@ class NamespacedControllerGeneratorTest < NamespacedGeneratorTestCase
end
class NamespacedModelGeneratorTest < NamespacedGeneratorTestCase
include GeneratorsTestHelper
arguments %w(Account name:string age:integer)
tests Rails::Generators::ModelGenerator
@ -142,7 +143,6 @@ class NamespacedModelGeneratorTest < NamespacedGeneratorTestCase
end
class NamespacedObserverGeneratorTest < NamespacedGeneratorTestCase
include GeneratorsTestHelper
arguments %w(account)
tests Rails::Generators::ObserverGenerator
@ -163,7 +163,6 @@ class NamespacedObserverGeneratorTest < NamespacedGeneratorTestCase
end
class NamespacedMailerGeneratorTest < NamespacedGeneratorTestCase
include GeneratorsTestHelper
arguments %w(notifier foo bar)
tests Rails::Generators::MailerGenerator