aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/testing
Commit message (Collapse)AuthorAgeFilesLines
* Use `--skip-webpack-install` by defaultyuuji.yaginuma2018-10-091-1/+1
| | | | To remove extra `--no-skip-javascript` tests.
* Make Webpacker the default JavaScript compiler for Rails 6 (#33079)David Heinemeier Hansson2018-09-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use Webpacker by default on new apps * Stop including coffee-rails by default * Drop using a js_compressor by default * Drop extra test for coffeescript inclusion by default * Stick with skip_javascript to signify skipping webpack * Don't install a JS runtime by default any more * app/javascript will be the new default directory for JS * Make it clear that this is just for configuring the default Webpack framework setup now * Start using the Webpack tag in the default layout * Irrelevant test * jQuery is long gone * Stop having asset pipeline compile default application.js * Add rails-ujs by default to the Webpack setup * Add Active Storage JavaScript to application.js pack by default * Consistent quoting * Add Turbolinks to default pack * Add Action Cable to default pack Need some work on how to set the global consumer that channels will work with. @javan? * Require all channels by default and use a separate consumer stub * Channel generator now targets Webpack style * Update task docs to match new generator style * Use uniform import style * Drop the JS assets generator It was barely helpful as it was. It’s no longer helpful in a Webpacked world. Sayonara! * Add app/javascript to the stats directories * Simpler import style Which match the other imports. * Address test failures from dropping JS compilation (and compression) * webpacker-default: Modify `AssetsGeneratorTest` Before: ``` $ bin/test test/generators/assets_generator_test.rb Run options: --seed 46201 F Failure: AssetsGeneratorTest#test_assets [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/assets_generator_test.rb:12]: Expected file "app/assets/javascripts/posts.js" to exist, but does not bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/assets_generator_test.rb:10 . Finished in 0.031343s, 63.8101 runs/s, 95.7152 assertions/s. 2 runs, 3 assertions, 1 failures, 0 errors, 0 skips ``` After: ``` $ bin/test test/generators/assets_generator_test.rb Run options: --seed 43571 .. Finished in 0.030370s, 65.8545 runs/s, 65.8545 assertions/s. 2 runs, 2 assertions, 0 failures, 0 errors, 0 skips ``` * webpacker-default: Modify `ChannelGeneratorTest` Before: ``` $ bin/test test/generators/channel_generator_test.rb Run options: --seed 8986 .F Failure: ChannelGeneratorTest#test_channel_with_multiple_actions_is_created [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:43]: Expected file "app/assets/javascripts/channels/chat.js" to exist, but does not bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:34 .F Failure: ChannelGeneratorTest#test_channel_is_created [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:29]: Expected file "app/assets/javascripts/channels/chat.js" to exist, but does not bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:22 E Error: ChannelGeneratorTest#test_cable_js_is_created_if_not_present_already: Errno::ENOENT: No such file or directory @ apply2files - /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/fixtures/tmp/app/assets/javascripts/cable.js bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:60 F Failure: ChannelGeneratorTest#test_channel_suffix_is_not_duplicated [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:87]: Expected file "app/assets/javascripts/channels/chat.js" to exist, but does not bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:80 F Failure: ChannelGeneratorTest#test_channel_on_revoke [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:77]: Expected file "app/assets/javascripts/cable.js" to exist, but does not bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:68 Finished in 0.064384s, 108.7227 runs/s, 481.4861 assertions/s. 7 runs, 31 assertions, 4 failures, 1 errors, 0 skips ``` After: ``` $ bin/test test/generators/channel_generator_test.rb Run options: --seed 44857 ....... Finished in 0.060243s, 116.1961 runs/s, 697.1764 assertions/s. 7 runs, 42 assertions, 0 failures, 0 errors, 0 skips ``` * Fix shared generator tests. * webpacker-default: Modify `ControllerGeneratorTest` The JS assets generator was dropped. ref. https://github.com/rails/rails/commit/46215b179483d3e4d264555f5a4952f43eb8142a * Revert "Simpler import style". It's currently failing with an error of "TypeError: undefined is not an object (evaluating '__WEBPACK_IMPORTED_MODULE_2_activestorage___default.a.start')". Waiting for @javan to have a look. This reverts commit 5d3ebb71059f635d3756cbda4ab9752027e09256. * require webpacker in test app * Add webpacker without making the build hang/timeout. (#33640) * use yarn workspaces to allow for installing unreleased packages and only generate js/bootsnap when required * no longer need to have webpacker in env templates as webpacker moved this config to yml file * Fix rubocop violation * Got the test passing for the running scaffold * update expected lines of code * update middleware tests to account for webpacker * disable js in plugins be default to get the tests passing (#34009) * clear codeclimate report issues * Anything newer than currently released is good * Use Webpacker development version during development of Rails * Edge should get development webpacker as well * Add changelog entry for Webpacker change
* [Railties] require_relative => requireAkira Matsuda2017-10-211-1/+1
| | | | This basically reverts 618268b4b9382f4bcf004a945fe2d85c0bd03e32
* Adding frozen_string_literal pragma to Railties.Pat Allan2017-08-143-0/+6
|
* Use `assert_nil` if `value` is nil in `assert_field_default_value`yuuji.yaginuma2017-08-031-1/+5
| | | | | It is deprecate to specify nil for expect argument of `assert_equal`. Ref: https://github.com/seattlerb/minitest/commit/922bc9151a622cb3ef0b9f170aa09c3bb72c7eb8
* [Railties] require => require_relativeAkira Matsuda2017-07-011-1/+1
|
* Add option for class_attribute default (#29270)David Heinemeier Hansson2017-05-291-4/+4
| | | | | | | | | | | | * Allow a default value to be declared for class_attribute * Convert to using class_attribute default rather than explicit setter * Removed instance_accessor option by mistake * False is a valid default value * Documentation
* Define path with __dir__bogdanvlviv2017-05-231-2/+2
| | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
* Privatize unneededly protected methods in RailtiesAkira Matsuda2016-12-251-5/+5
|
* code gardening: removes redundant selfsXavier Noria2016-08-081-4/+4
| | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* applies remaining conventions across the projectXavier Noria2016-08-062-5/+4
|
* applies new string literal convention in railties/libXavier Noria2016-08-061-11/+11
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Merge pull request #21912 from y-yagi/move_prepare_destination_to_publicSean Griffin2015-10-081-1/+2
|\ | | | | change `prepare_destination` to public API [ci skip]
| * change `prepare_destination` to public API [ci skip]yuuji.yaginuma2015-10-081-1/+2
| | | | | | | | | | | | | | `prepare_destination` has been used in the template file for the generator, I think it should be a public API ref: https://github.com/rails/rails/blob/master/railties/lib/rails/generators/test_unit/generator/templates/generator_test.rb#L8
* | remove unused requireyuuji.yaginuma2015-10-081-2/+0
|/ | | | `shellwords` is no longer needed from #20605.
* assert_file understands paths with special charactersDiego Carrion2015-06-181-1/+1
| | | fixes #20042
* - Extracted silence_stream method to new module in activesupport/testing.Vipul A M2015-01-201-16/+2
| | | | | | | | | | | | - Added include for the same in ActiveSupport::Test. - Removed occurrences of silence_stream being used elsewhere. - Reordered activesupport testcase requires alphabetically. - Removed require of silence stream from test_case - Moved quietly method to stream helper - Moved capture output to stream helper module and setup requires for the same elsewhere
* Fix example code for `Rails::Generators::Testing::Behaviour` [ci skip]Ryunosuke SATO2014-10-171-1/+1
| | | | | `cleanup_destination_root` method is not found anywhere. Instead, `prepare_destination` clean up distination root on setup.
* Keep quietly and capture undeprecated on your suiteRafael Mendonça França2014-07-151-0/+17
|
* Require shellwords since it is dependecy of this fileRafael Mendonça França2014-06-261-0/+2
| | | | Closes #15919
* Removing without_thor_debugArun Agrawal2014-01-111-13/+3
| | | | | a1d0c0fa3d8ca97edc8f2a1d6ba96af19221dbad as bundler 1.5.2 is out now
* Reverse 821525e and wrap run_generator callAndrew White2014-01-021-3/+13
| | | | | | Ruby 2.1.0 includes the json gem 1.8.1 by default so we need bundler 1.5.1 for `bundle install` to work. To fix this reverse the downgrade to 1.3.5 and wrap the `run_generator` call with a block that resets `THOR_DEBUG`.
* More Warnings removed for ruby trunkArun Agrawal2013-11-011-2/+2
| | | | Same as 4d4ff531b8807ee88a3fc46875c7e76f613956fb
* Make the application name snake cased when it contains spacesRobin Dupret2013-10-221-1/+1
| | | | | | | | | | | | | The application name is used to fill the `database.yml` and `session_store.rb` files ; previously, if the provided name contained whitespaces, it led to unexpected names in these files. Since Shellwords.escape adds backslashes to escape spaces, the app_name should remove them and replace any space with an underscore (just like periods previously). Also improve the assert_file helper to work with paths containing spaces using String#shellescape.
* Revert "Merge pull request #10194 from ↵Carlos Antonio da Silva2013-04-121-3/+1
| | | | | | | pabloh/extract_regexp_at_generators_testing_assertion" This reverts commit 81f243375b9d3cfd431c1ca904c5c1efc9a41ae8, reversing changes made to c7673b0981d961e5510c85d958c944876d543314.
* Extract method declaration regexp into a constantPablo Herrero2013-04-121-1/+3
|
* Avoid running bundler on tests that don't need itSam Ruby2013-04-031-1/+4
|
* Move the class methods to above the protected sectionRafael Mendonça França2013-04-013-47/+36
|
* Break down Rails::Generator::TestCase into modulesPablo Herrero2013-03-313-0/+253