aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/named_base_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Generate the correct path in nested scaffold generatoryuuji.yaginuma2017-11-051-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, namespaced scaffold generator will generate an incorrect path and the generated file will not work properly. ``` $ ./bin/rails g scaffold admin/user $ ./bin/rails db:migrate $ ./bin/rails t test/controllers # Running: E Error: Admin::UsersControllerTest#test_should_create_admin_user: NameError: undefined local variable or method `admin_admin_users_url' for #<Admin::UsersControllerTest:0x000055a59f25ff68> Did you mean? admin_users test/controllers/admin/users_controller_test.rb:20:in `block (2 levels) in <class:UsersControllerTest>' test/controllers/admin/users_controller_test.rb:19:in `block in <class:UsersControllerTest>' bin/rails test test/controllers/admin/users_controller_test.rb:18 ``` This is because combine `controller_class_path` and `singular_table_name` to generate route. https://github.com/rails/rails/blob/360698aa245b45349d1d1b12e1afb34759515e69/railties/lib/rails/generators/named_base.rb#L172 Normally, if using namspaced generator, table name already contains namespace. Therefore, adding `controller_class_path` adds extra namespace. Since it is special only when explicitly specifying `model-name`, it is modified to change the value only when `model-name`is specified. Follow up of #30729
* Fix "warning: method redefined; discarding old test_scaffold_plural_names"yuuji.yaginuma2017-09-301-2/+2
| | | | | | | | | | | | Since warning was issued due to duplication of test names, fix the test name to a meaningful name. This fixes following warnings: ``` railties/test/generators/named_base_test.rb:141: warning: method redefined; discarding old test_scaffold_plural_names railties/test/generators/named_base_test.rb:62: warning: previous definition of test_scaffold_plural_names was here ```
* scaffold nested name controller should be fine.yalab2017-09-271-0/+13
|
* Adding frozen_string_literal pragma to Railties.Pat Allan2017-08-141-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Privatize unneededly protected methods in Railties testsAkira Matsuda2016-12-241-1/+1
|
* improve error message when include assertions failMichael Grosser2016-09-161-2/+2
| | | | | | assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
* applies new string literal convention in railties/testXavier Noria2016-08-061-72/+72
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Removed duplicate requiring minitest/mock as it is already required in ↵Ronak Jangir2015-08-261-1/+0
| | | | method_call_assertions
* Remove use of mocha in the named base testsSemyon Pupkov2015-04-281-10/+13
|
* tests, reset global to previous value.Yves Senn2015-02-091-1/+3
| | | | | The default of the global might change. It's better to reset it to what it was than a hardcoded value.
* Remove warning from generator named base testYuki Nishijima2015-02-081-10/+0
| | | | | | | | | This removes the following warning: railties/test/generators/named_base_test.rb:9: warning: method redefined; discarding old pluralize_table_names activesupport/lib/active_support/core_ext/class/attribute.rb:86: warning: previous definition of pluralize_table_names was here railties/test/generators/named_base_test.rb:9: warning: method redefined; discarding old pluralize_table_names= activesupport/lib/active_support/core_ext/class/attribute.rb:83: warning: previous definition of pluralize_table_names= was here
* Stop requiring mocha automaticallyRafael Mendonça França2014-07-191-0/+1
| | | | | | | | | | | We are planning to remove mocha from our test suite because of performance problems. To make this possible we should stop require mocha on ActionSupport::TestCase. This should not affect applications since users still need to add mocha to Gemfile and this already load mocha. Added FIXME notes to place that still need mocha removal
* Added --model-name option scaffold_controller_generator.yalab2013-10-151-0/+19
|
* Add convenience method to hide a generator from the available onesCarlos Antonio da Silva2012-02-031-0/+9
| | | | | | It is usually useful to be able to hide a generator when running rails generate command. Such generators might be used only to dry up generators code and shouldn't be available to end users.
* Fixed issue #6363, avoid to pluralized already pluralized names and ↵Timothy N. Tsvetkov2011-02-161-0/+5
| | | | | | | | singularize a single in generators, for example stadia is a valid plural for stadium. But calling pluralize for stadia will return stadias which sematically is not corrent in this case [#6363 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Make polymorphic_url and scaffolding work with uncountable resources [#3930 ↵Andrew White2010-06-201-0/+10
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Load generators from both lib/rails/generators and lib/generators. Using the ↵José Valim2010-03-231-1/+1
| | | | former since it's less obstrusive.
* Use human_name in scaffold.José Valim2010-03-171-0/+18
|
* More work on generated mailer templates.José Valim and Mikel Lindsaar2010-01-261-0/+8
|
* Change mailer generator templates and refactor the whole naming schema.José Valim and Mikel Lindsaar2010-01-251-15/+47
|
* Get generators tests running on Ruby 1.9.1José Valim2010-01-191-1/+2
|
* Generators load path now will be Ruby load path. If you want to use ↵José Valim2010-01-181-1/+1
| | | | rspec:install generator, you need generators/rspec/install_generator in your load path.
* Move all generators tests to use new test case syntax.José Valim2010-01-031-4/+4
|
* Move railties/lib/* into railties/lib/*Yehuda Katz + Carl Lerche2009-09-241-1/+1
|
* rm -rf rails_generator/generatorsJosé Valim2009-07-021-0/+42