Module: CrudTestHelper
- Included in:
- CrudTestModelsControllerTest, CustomAssertionsTest, DryCrud::Form::BuilderTest, FormHelperTest, FormatHelperTest, I18nHelperTest, TableHelperTest, UtilityHelperTest
- Defined in:
- lib/generators/dry_crud/templates/test/support/crud_test_helper.rb
Overview
A simple test helper to prepare the test database with a CrudTestModel model. This helper is used to test the CrudController and various helpers without the need for an application based model.
Instance Method Summary collapse
- #action_name ⇒ Object
- #controller_name ⇒ Object
- #h(text) ⇒ Object
-
#model_class ⇒ Object
Controller helper methods for the tests.
- #params ⇒ Object
- #path_args(entry) ⇒ Object
- #sortable?(_attr) ⇒ Boolean
Instance Method Details
#action_name ⇒ Object
22 23 24 |
# File 'lib/generators/dry_crud/templates/test/support/crud_test_helper.rb', line 22 def action_name 'index' end |
#controller_name ⇒ Object
18 19 20 |
# File 'lib/generators/dry_crud/templates/test/support/crud_test_helper.rb', line 18 def controller_name 'crud_test_models' end |
#h(text) ⇒ Object
38 39 40 |
# File 'lib/generators/dry_crud/templates/test/support/crud_test_helper.rb', line 38 def h(text) ERB::Util.h(text) end |
#model_class ⇒ Object
Controller helper methods for the tests
14 15 16 |
# File 'lib/generators/dry_crud/templates/test/support/crud_test_helper.rb', line 14 def model_class CrudTestModel end |
#params ⇒ Object
26 27 28 |
# File 'lib/generators/dry_crud/templates/test/support/crud_test_helper.rb', line 26 def params {} end |
#path_args(entry) ⇒ Object
30 31 32 |
# File 'lib/generators/dry_crud/templates/test/support/crud_test_helper.rb', line 30 def path_args(entry) entry end |
#sortable?(_attr) ⇒ Boolean
34 35 36 |
# File 'lib/generators/dry_crud/templates/test/support/crud_test_helper.rb', line 34 def sortable?(_attr) true end |