mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
A few more tests asserting the presence of helper test stubs
This commit is contained in:
parent
206347fd3e
commit
e5632f37f7
6 changed files with 0 additions and 17 deletions
|
@ -16,4 +16,3 @@ Example:
|
|||
Test: test/controllers/credit_cards_controller_test.rb
|
||||
Views: app/views/credit_cards/debit.html.erb [...]
|
||||
Helper: app/helpers/credit_cards_helper.rb
|
||||
Test: test/helpers/credit_cards_helper_test.rb
|
||||
|
|
|
@ -5,13 +5,9 @@ Description:
|
|||
To create a helper within a module, specify the helper name as a
|
||||
path like 'parent_module/helper_name'.
|
||||
|
||||
This generates a helper class in app/helpers and invokes the configured
|
||||
test framework.
|
||||
|
||||
Example:
|
||||
`rails generate helper CreditCard`
|
||||
|
||||
Credit card helper.
|
||||
Helper: app/helpers/credit_card_helper.rb
|
||||
Test: test/helpers/credit_card_helper_test.rb
|
||||
|
||||
|
|
|
@ -28,13 +28,11 @@ class ControllerGeneratorTest < Rails::Generators::TestCase
|
|||
def test_invokes_helper
|
||||
run_generator
|
||||
assert_file "app/helpers/account_helper.rb"
|
||||
assert_file "test/helpers/account_helper_test.rb"
|
||||
end
|
||||
|
||||
def test_does_not_invoke_helper_if_required
|
||||
run_generator ["account", "--skip-helper"]
|
||||
assert_no_file "app/helpers/account_helper.rb"
|
||||
assert_no_file "test/helpers/account_helper_test.rb"
|
||||
end
|
||||
|
||||
def test_invokes_assets
|
||||
|
|
|
@ -47,7 +47,6 @@ class NamespacedControllerGeneratorTest < NamespacedGeneratorTestCase
|
|||
def test_helper_is_also_namespaced
|
||||
run_generator
|
||||
assert_file "app/helpers/test_app/account_helper.rb", /module TestApp/, / module AccountHelper/
|
||||
assert_file "test/helpers/test_app/account_helper_test.rb", /module TestApp/, / class AccountHelperTest/
|
||||
end
|
||||
|
||||
def test_invokes_default_test_framework
|
||||
|
@ -229,7 +228,6 @@ class NamespacedScaffoldGeneratorTest < NamespacedGeneratorTestCase
|
|||
|
||||
# Helpers
|
||||
assert_file "app/helpers/test_app/product_lines_helper.rb"
|
||||
assert_file "test/helpers/test_app/product_lines_helper_test.rb"
|
||||
|
||||
# Stylesheets
|
||||
assert_file "app/assets/stylesheets/scaffold.css"
|
||||
|
@ -260,7 +258,6 @@ class NamespacedScaffoldGeneratorTest < NamespacedGeneratorTestCase
|
|||
|
||||
# Helpers
|
||||
assert_no_file "app/helpers/test_app/product_lines_helper.rb"
|
||||
assert_no_file "test/helpers/test_app/product_lines_helper_test.rb"
|
||||
|
||||
# Stylesheets (should not be removed)
|
||||
assert_file "app/assets/stylesheets/scaffold.css"
|
||||
|
@ -297,7 +294,6 @@ class NamespacedScaffoldGeneratorTest < NamespacedGeneratorTestCase
|
|||
|
||||
# Helpers
|
||||
assert_file "app/helpers/test_app/admin/roles_helper.rb"
|
||||
assert_file "test/helpers/test_app/admin/roles_helper_test.rb"
|
||||
|
||||
# Stylesheets
|
||||
assert_file "app/assets/stylesheets/scaffold.css"
|
||||
|
@ -329,7 +325,6 @@ class NamespacedScaffoldGeneratorTest < NamespacedGeneratorTestCase
|
|||
|
||||
# Helpers
|
||||
assert_no_file "app/helpers/test_app/admin/roles_helper.rb"
|
||||
assert_no_file "test/helpers/test_app/admin/roles_helper_test.rb"
|
||||
|
||||
# Stylesheets (should not be removed)
|
||||
assert_file "app/assets/stylesheets/scaffold.css"
|
||||
|
@ -366,7 +361,6 @@ class NamespacedScaffoldGeneratorTest < NamespacedGeneratorTestCase
|
|||
|
||||
# Helpers
|
||||
assert_file "app/helpers/test_app/admin/user/special/roles_helper.rb"
|
||||
assert_file "test/helpers/test_app/admin/user/special/roles_helper_test.rb"
|
||||
|
||||
# Stylesheets
|
||||
assert_file "app/assets/stylesheets/scaffold.css"
|
||||
|
@ -397,7 +391,6 @@ class NamespacedScaffoldGeneratorTest < NamespacedGeneratorTestCase
|
|||
|
||||
# Helpers
|
||||
assert_no_file "app/helpers/test_app/admin/user/special/roles_helper.rb"
|
||||
assert_no_file "test/helpers/test_app/admin/user/special/roles_helper_test.rb"
|
||||
|
||||
# Stylesheets (should not be removed)
|
||||
assert_file "app/assets/stylesheets/scaffold.css"
|
||||
|
|
|
@ -36,7 +36,6 @@ class ResourceGeneratorTest < Rails::Generators::TestCase
|
|||
assert_file "test/controllers/accounts_controller_test.rb", /class AccountsControllerTest < ActionController::TestCase/
|
||||
|
||||
assert_file "app/helpers/accounts_helper.rb", /module AccountsHelper/
|
||||
assert_file "test/helpers/accounts_helper_test.rb", /class AccountsHelperTest < ActionView::TestCase/
|
||||
end
|
||||
|
||||
def test_resource_controller_with_actions
|
||||
|
|
|
@ -81,7 +81,6 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
|
|||
def test_helper_are_invoked_with_a_pluralized_name
|
||||
run_generator
|
||||
assert_file "app/helpers/users_helper.rb", /module UsersHelper/
|
||||
assert_file "test/helpers/users_helper_test.rb", /class UsersHelperTest < ActionView::TestCase/
|
||||
end
|
||||
|
||||
def test_views_are_generated
|
||||
|
@ -126,7 +125,6 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
|
|||
def test_skip_helper_if_required
|
||||
run_generator ["User", "name:string", "age:integer", "--no-helper"]
|
||||
assert_no_file "app/helpers/users_helper.rb"
|
||||
assert_no_file "test/helpers/users_helper_test.rb"
|
||||
end
|
||||
|
||||
def test_skip_layout_if_required
|
||||
|
|
Loading…
Reference in a new issue