aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/actions_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Layout/EmptyLinesAroundAccessModifier` copRyuta Kamizono2019-06-131-1/+0
| | | | | | | | | | | We sometimes say "✂️ newline after `private`" in a code review (e.g. https://github.com/rails/rails/pull/18546#discussion_r23188776, https://github.com/rails/rails/pull/34832#discussion_r244847195). Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style `EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059). That cop and enforced style will reduce the our code review cost.
* Address new cop offence in railtiesRyuta Kamizono2019-04-121-1/+1
| | | | | It is necessary to run `rubocop` manually when new cop is added since codeclimate checks any offences only in files touched in PRs.
* Don't add `RAILS_ENV` in generate actionyuuji.yaginuma2019-01-191-0/+6
| | | | | | | In the case of generator, `RAILS_ENV` is interpreted as an argument as it is. Avoid this because it will result unintended by the user. Fixes #34979.
* Remove deprecated `capify!`Rafael Mendonça França2019-01-171-9/+0
|
* Abort early if generator command fails (#34420)David Rodríguez2018-12-071-2/+14
| | | | | | | | | | | | | | | | * No need to go through ruby * Abort early if a generator command fails * Reuse `rails_command` method * Bump thor minimum dependency to 0.20.3 * Add some minimal docs * Add a changelog entry * Restore original logging
* Fix test name to match the test behavioryuuji.yaginuma2018-11-181-4/+4
| | | | These tests are for testing the `rake` method.
* Add `Style/RedundantFreeze` to remove redudant `.freeze`Yasuo Honda2018-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | 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'
* add github to template actions, light DSL refactorBarry Allard2018-08-301-0/+38
|
* prefer File.write for bulk writesXavier Noria2018-05-051-1/+1
| | | | | | | | | | | | | | | | | | I saw these ones while working on #32362. File.write was introduced in Ruby 1.9.3 and it is the most concise way to perform bulk writes (as File.read is for bulk reading). The existing flags enabled binmode, but we are dumping text here. The portable way to dump text is text mode. The only difference is newlines, and portable code should in particular emit portable newlines. Please note the hard-coded \ns are still correct. In languages with C semantics for newlines like Ruby, Python, Perl, and others, "\n" is a portable newline. Both when writing and when reading. On Windows, the I/O layer is responsible for prepending a CR before each LF on writing, and removing CRs followed by LFs on reading. On Unix, binmode is a no-op.
* Rails::Generators::Actions#execute_command allows option `capture`bogdanvlviv2017-11-061-0/+16
|
* Merge pull request #30323 from yhirano55/support_multiple_version_for_gem_methodMatthew Draper2017-08-311-4/+11
|\ | | | | Support multiple versions arguments for `gem` method of Generators
| * Support multiple versions arguments for `gem` method of GeneratorsYoshiyuki Hirano2017-08-191-4/+11
| |
* | Remove frozen_string_literal magic comment from templatesKoichi ITO2017-08-221-2/+0
|/
* Add frozen string pragma to expected routes files.Pat Allan2017-08-141-0/+2
|
* Adding frozen_string_literal pragma to Railties.Pat Allan2017-08-141-0/+2
|
* Optimize indentation for generator actionsYoshiyuki Hirano2017-08-111-6/+66
|
* 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
|
* Deprecate an `capify!` method in generators and templatesyuuji.yaginuma2017-06-181-2/+5
| | | | | | | | | The `capify` command has been removed by Capistrano 3 and became to `cap install`. Therefore, the `capify!` method has no meaning in Capistrano 3. I think that should deprecate. Ref: https://github.com/capistrano/capistrano/commit/492793916acf32ffe1604daec6fd4892c8935018
* Privatize unneededly protected methods in Railties testsAkira Matsuda2016-12-241-1/+1
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-3/+3
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* applies new string literal convention in railties/testXavier Noria2016-08-061-79/+79
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* AppGenerator: allow both 'rake' and 'rails'claudiob2016-03-091-5/+5
| | | | | | | | | This commit comes from the comments made by @matthewd at https://github.com/rails/rails/pull/23795/files#r54469637 and by @rafaelfranca at https://github.com/rails/rails/pull/23795/files#r54609364 The idea is that if you type (for example) "rake db:migrate" in an AppGenerator, then this should actually invoke `rake db:migrate` on the command line, whereas if you type "rails_command db:migrate", this should invoke `rails db:migrate`.
* - Made changes to have test cases in actions_test more readable.Mohit Natoo2016-02-291-6/+6
| | | | Changed description with tests related to rails_command.
* - Made changes to have test cases in actions_test more readable.Mohit Natoo2016-02-291-5/+5
|
* Invoke 'rails' instead of 'rake' in AppGeneratorclaudiob2016-02-201-10/+10
| | | | | Follows the convention from Rails 5 of invoking tasks on the command-line with `rails …` rather than `rake …`.
* AppGenerator: Replace 'rake' with 'rails_command'claudiob2016-02-201-0/+38
| | | | | | | | | | | Since Rails 5.0 is switching the Rails command line from 'rake …' to 'rails …', it makes sense to also replace the `rake` method in the Rails templates API. Based on feedback from @matthewd and @kaspth, I chose to replace `rake` with `rails_command`, which is less confusing than the alternatives `rails` or `command` or `rails_run` and is not Thor-reserved word like `task`.
* Rails::Generators::Actions#gem should work even if frozen string is passed ↵Prathamesh Sonpatki2016-01-241-0/+8
| | | | | | as argument - Fixes #23137.
* Fixes using `add_source` with a block after using `gem` in a custom railsWill Fisher2015-12-211-0/+9
| | | | generator template.
* Fix testsDavid Heinemeier Hansson2015-12-171-2/+0
|
* Fix testDavid Heinemeier Hansson2015-12-161-1/+10
|
* Route generator should be idempotent - closes #22082Thiago Pinto2015-10-311-0/+15
|
* Cleaned up generators tests using internal assertion helperRonak Jangir2015-08-201-26/+11
|
* cherry-pick test and source doc from #20050Hirofumi Wakasugi2015-06-251-0/+8
|
* Removed use of mocha from railties actions_testRonak Jangir2015-06-011-27/+52
|
* Add a new-line to the end of route method generated code.Arthur Neves2015-03-181-0/+24
| | | | | | | | Fix regression on route method that was added by bac812a7ef2660a2fe2ab00822e5e66228379822. The regression was that when calling the `route` method, we were not appending a \n anymore. [fixes #19316]
* README.rdoc -> README.md for newly generated applicationsXavier Noria2015-02-061-2/+2
| | | | | | README.rdoc was generated to support the doc:app task. Now that this task is gone we can switch to Markdown, which is nowadays a better default.
* Remove some warning with Ruby 2.2Rafael Mendonça França2014-12-291-1/+1
|
* fix broken `gem` method with non-String arguments. Closes #16709.Yves Senn2014-08-271-0/+10
| | | | This was caused by #15327.
* Merge branch 'rm-remove-mocha'Rafael Mendonça França2014-07-191-0/+1
|\ | | | | | | | | Conflicts: actionpack/test/abstract_unit.rb
| * 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
* | Keep quietly and capture undeprecated on your suiteRafael Mendonça França2014-07-151-1/+1
|/
* Merge pull request #15327 from alexbel/replace_double_quotes_with_single_quotesYves Senn2014-05-271-7/+15
|\ | | | | | | Replace double quotes with single quotes while adding an entry into Gemfile
| * Replace double quotes with single quotes while adding an entry into Gemfilealexbel2014-05-261-7/+7
|/
* Removing the app constant and replacing it with Rails.applicationwangjohn2013-04-301-1/+1
| | | | | syntax. This helps removing the class level abstraction of an application.
* Fix readme testsCarlos Antonio da Silva2013-01-071-2/+2
| | | | Related to the change introduced in 6cf47c533d7d6784d34fc31406a335555e0c32b8.
* Introduce ./bin for your app's executables: bin/bundle, bin/rails, bin/rake. ↵Jeremy Kemper2013-01-061-1/+1
| | | | Executable scripts are versioned code like the rest of your app. To generate a stub for a bundled gem: 'bundle binstubs unicorn' and 'git add bin/unicorn'
* Refactor tests that switch RAILS_ENV and RACK_ENVCarlos Antonio da Silva2012-12-061-16/+15
| | | | | | | | | | | | This cleanup aims to fix a build failure: https://travis-ci.org/rails/rails/jobs/3515951/#L482 Since travis always have both ENV vars set to "test", a test is failing where it's expected to output the default env "development", but "test" is the result due to RACK_ENV being set when we expect it to not be. By cleaning this duplication we ensure that changing any of these env variables will pick the right expected value.
* Use Ruby 1.9 Hash syntax in railtiesRobin Dupret2012-10-141-18/+18
|