aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/resource_generator_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add `Style/RedundantFreeze` to remove redudant `.freeze`Yasuo Honda2018-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | Since Rails 6.0 will support Ruby 2.4.1 or higher `# frozen_string_literal: true` magic comment is enough to make string object frozen. This magic comment is enabled by `Style/FrozenStringLiteralComment` cop. * Exclude these files not to auto correct false positive `Regexp#freeze` - 'actionpack/lib/action_dispatch/journey/router/utils.rb' - 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb' It has been fixed by https://github.com/rubocop-hq/rubocop/pull/6333 Once the newer version of RuboCop released and available at Code Climate these exclude entries should be removed. * Replace `String#freeze` with `String#-@` manually if explicit frozen string objects are required - 'actionpack/test/controller/test_case_test.rb' - 'activemodel/test/cases/type/string_test.rb' - 'activesupport/lib/active_support/core_ext/string/strip.rb' - 'activesupport/test/core_ext/string_ext_test.rb' - 'railties/test/generators/actions_test.rb'
* Emit warning for unknown inflection rule when generating model.Yoshiyuki Kinjo2018-08-311-1/+5
| | | | | | For words like "abuse", Rails cannot derive its singular form from plural form "abuses" without defining custom inflection rule. `rails generate model` and its families now emit warning for this case.
* 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
|
* applies new string literal convention in railties/testXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Generate application_record.rb file before model fileWojciech Wnętrzak2016-06-081-2/+2
| | | | | | Previously model file was generated first, which resulted in inheriting from `ActiveRecord::Base`, but since application_record.rb is generated as well, it should already be used.
* Update test generators to use ActionDispatch::IntegrationTestAbdelkader Boudih2015-12-151-1/+1
| | | | | | | | | | | | In Rails 5.1 `ActionController::TestCase` will be moved out of Rails into it's own gem. Please use `ActionDispatch::IntegrationTest` going forward. This changes the generators to use `ActionDispatch::IntegrationTest` and the required URL setup (rather than symbols) for each of the controller actions. Updated fix to #22076.
* Revert "Merge pull request #22569 from seuros/remove-test-case"eileencodes2015-12-131-1/+1
| | | | | | | | | This reverts commit 9712a7a12b7f9e4dcef751ceda8a73c3f4beb11f, reversing changes made to 3e65c3d3886336e9145438cdeacaf4ebec6a48b8. Reverting because this caused test failures and while we have a followup branch there is still one failure that happens randomly and isn't straight forward to fix.
* Controller generators should be creating IntegrationTest stubs instead of ↵Abdelkader Boudih2015-12-131-1/+1
| | | | ControllerTest
* A few more tests asserting the presence of helper test stubsDavid Heinemeier Hansson2014-08-031-1/+0
|
* modify model generator warning message. refs [#174c9f0]Kuldeep Aggarwal2014-02-271-3/+3
|
* build fix. follow up to 174c9f0df39cd338a4871f82794256cc64f68a81Yves Senn2014-02-241-1/+1
|
* Add warning when user tried to create model with pluralize name.Kuldeep Aggarwal2014-02-231-1/+1
| | | | | 1. Generate model with correct_name. 2. It will help new users to avoid mistakes when tried to create model with wrong name.
* Use Ruby 1.9 Hash syntax in railtiesRobin Dupret2012-10-141-1/+1
|
* Update test locationsMike Moore2012-10-091-5/+5
| | | | | | | | | | | | | | Change the default test locations to avoid confusion around the common testing terms "unit" and "functional". Add new rake tasks for the new locations, while maintaining backwards compatibility with the old rake tasks. New testing locations are as follows: app/models -> test/models (was test/units) app/helpers -> test/helpers (was test/units/helpers) app/controllers -> test/controllers (was test/functional) app/mailers -> test/mailers (was test/functional)
* Remove --http.José Valim2012-03-141-6/+0
|
* Generate special controller and functional test templates for http appsCarlos Antonio da Silva2012-03-141-0/+6
| | | | | | | | | | | | The main goal is to not generate the format.html block in scaffold controller, and to generate a different functional test as we don't rely on redirects anymore, we should test for http responses. In addition to that, the :edit action is removed from the http controller and the edit route is not generated by default, as they usually do not make sense in this scenario. [Carlos Antonio da Silva & Santiago Pastorino]
* be sure to parenthesize the arguments when the first one is a RegExp literalAkira Matsuda2011-05-181-7/+7
| | | | | | this fixes: "warning: ambiguous first argument; put parentheses or even spaces" because: you need this to tell the parser that you're not calling :/ method (division) details (Japanese!): http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-dev/42445?42370-43277
* The model generator shouldn't throw warnings when using mass nouns [#5363 ↵Jeff Kreeftmeijer2010-11-111-0/+5
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Remove the --singeleton option from scaffold generator.Prem Sichanugrist2010-06-241-8/+0
| | | | | | | | It turned out to be that scaffold for singeleton resource will always depend on another model, and it's not possible at the moment to make the application tests pass after generate the singeleton scafold. So, it would be better to remove it for now and probably provide another generator, such as singeleton_scaffold, in which also require the depended model name. [#4863 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.
* Controller generator now creates routes as well [#4233 state:resolved]José Valim2010-03-191-9/+1
|
* 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-8/+1
|
* Create Rails::Generators::TestCase.José Valim2010-01-031-2/+2
|
* Scaffolding generates new routing dsl examplesJoshua Peek2009-12-091-3/+3
|
* Pass config.generators options along when RAILS_GENERATORS is set and show ↵José Valim2009-11-031-1/+1
| | | | | | --force-plural message just once. Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* CI breakageYehuda Katz2009-11-021-1/+1
| | | | This reverts commit a288b74f1c75c6f100de7611a5093a421f1ad6d1.
* Generators should use Rails.root instead of Dir.pwd [#3408 status:resolved]José Valim2009-10-281-1/+1
| | | | Signed-off-by: Yehuda Katz <wycats@gmail.com>
* Move railties/lib/* into railties/lib/*Yehuda Katz + Carl Lerche2009-09-241-1/+1
|
* Updated vendored Thor to 0.11.1 and update Rails::Generators.José Valim2009-07-141-1/+1
|
* Added lookup to generators.José Valim2009-07-031-12/+0
|
* Ensure both migration and routes are removed on revoke.José Valim2009-07-021-2/+11
|
* Started with scaffold controller and added remove_hook_for.José Valim2009-07-021-0/+14
|
* Simplifying resource generator.José Valim2009-06-291-6/+0
|
* Added singleton support to resource controller.José Valim2009-06-281-0/+14
|
* Added tessts for resources generator.José Valim2009-06-281-0/+87