aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
Commit message (Collapse)AuthorAgeFilesLines
...
| * set association name to generated fixtures if attribute is referenceyuuji.yaginuma2016-02-062-10/+9
| | | | | | | | | | | | | | It has been changed to require `belongs_to` by default in Rails 5. Therefore in order to pass the controller test, have association of set to fixtures. Fixes #23384
* | prevent apps in the railties test suite from running the evented monitorXavier Noria2016-02-101-3/+12
| |
* | include spring-watcher-listen in the Gemfile of new applicationsXavier Noria2016-02-101-0/+1
| |
* | enables the evented monitor in new applicationsXavier Noria2016-02-101-0/+22
| |
* | revert dev:cache to rake task, fixes #23410Scott Bronson2016-02-072-32/+34
|/
* Fix mixing line filters with Minitest's -n filter.Kasper Timm Hansen2016-02-051-0/+24
| | | | | | | | | | | Previous commit accidentally broke mixing line filters with string -n filter. Fix by checking if it is a string and returning it. We also need to ensure the -n filter carry forward into any other composite filters. Fix by letting the named filter be extractable, so we'll keep this for the next runnable's run.
* - app generate option --skip-sprockets leaves jquery-rails gem, which relies ↵Vipul A M2016-02-041-1/+2
| | | | | | | | on sprockets environment - Remove jquery-rails if --skip-sprockets is true Fixes #23431
* Update assertion on redis in generated GemfilePrem Sichanugrist2016-02-041-1/+1
| | | | | | | | Redis now included in Gemfile but commented out. This change was made in 91864439c7aebb6ca710831aac6781903a433904 and is causing the test failure. See https://travis-ci.org/rails/rails/jobs/106994913#L1025
* Fix model test path typo uncovered in previous commit.Kasper Timm Hansen2016-02-031-1/+1
| | | | | | | | | | | | Because of the expanding whitelist for test filters, this test ended up running the tests on lines 4 and 9 in the post test even though the path wasn't right. Happened incidentally because the same line numbers were used in both account and post test. Add the .rb line so the file is required correctly and the filters are applied.
* Fix line filters running tests from multiple runnables.Kasper Timm Hansen2016-02-031-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | `derive_regexp` was written with the assumption that we were run from a blank slate — that if the filter didn't match we might as well return it because it was nil. This isn't the case because minitest calls `run` on every runnable. Which is any subclass of Minitest::Runnable, such as ActiveSupport::TestCase, ActionDispatch::IntegrationTest as well as any inheriting from those. Thus after the first `run` we'd have put in a composite filter in `options[:filter]` making the next `run` create a linked list when it failed to match the regexp and put the composite filter as the head. Every runnable would accumulate more and more of the same filters, which effectively acted like an expanding whitelist and we ran tests from other runnables. Clog the accumulation by returning nil if there's no filter to derive a regexp from. Note: we pass a seed in the tests because Minitest shuffles the runnables to ensure the whitelist is expanded enough that the failure is triggered.
* use rails command in routes taskyuuji.yaginuma2016-02-031-7/+7
| | | | | For other task has become to use the rails command at doc and test, I think that routes task also it is better to use the rails command.
* Merge pull request #23420 from y-yagi/move_api_test_to_appropriate_fileRafael França2016-02-022-11/+10
|\ | | | | move `test_generator_if_skip_action_cable_is_given_for_an_api_app` to the appropriate file
| * move `test_generator_if_skip_action_cable_is_given_for_an_api_app` to the ↵yuuji.yaginuma2016-02-022-11/+10
| | | | | | | | | | | | appropriate file Test of Rails API should be in `api_app_generator_test.rb`.
* | Generated engines should protect from forgeryAaron Patterson2016-02-011-3/+3
|/ | | | | | Generated engines should call `protect_from_forgery`. If this method isn't called, then the Engine could be susceptible to XSS attacks. Thanks @tomekr for reporting this to us!
* Merge pull request #23225 from vipulnsward/20420-rake-routes-optionsKasper Timm Hansen2016-02-011-2/+61
|\ | | | | Add options for rake routes task
| * Add options for rake routes taskVipul A M2016-02-021-2/+61
| | | | | | | | | | | | | | | | | | | | Add two options: `-c` and `-g`. `-g` option returns the urls name, verb and path fields that match the pattern. `-c` option returns the urls for specific controller. Fixes #18902, and Fixes #20420 [Anton Davydov & Vipul A M]
* | Merge pull request #23025 from ↵Sean Griffin2016-02-012-3/+3
|\ \ | |/ |/| | | | | yahonda/shorten_internal_metadata_table_name_less_than_30_byte Shorten ActiveRecord::InternalMetadata.table_name to ar_internal_metadata
| * Shorten ActiveRecord::InternalMetadata.table_name to ar_internal_metadataYasuo Honda2016-02-012-3/+3
| | | | | | | | to support Oracle database which only supports 30 byte identifier length
* | Merge pull request #23057 from schneems/schneems/default-puma-configRichard Schneeman2016-02-011-0/+9
|\ \ | | | | | | Add Default Puma Config
| * | Add Default Puma Configschneems2016-01-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the `puma` command is run without any configuration options it will detect presence of a `config/puma.rb` file and use that. Currently there is discrepancy between `puma` command and `rails server` but Evan said it would be reasonable to add in reading in config from the default location. I am working on that right now as a feature in puma/puma. Why do we need this? By default Puma uses 16 threads, and by default ActiveRecord only has 5 threads. Due to the architecture of AR it is guaranteed that if you're running with fewer DB connections than your server has threads you will hit `ActiveRecord::ConnectionTimeoutError ` eventually if your app gets modest amounts of traffic. Since we are providing a default webserver, we should provide reasonable configuration for that webserver. This PR does a few things, first it sets the default Puma thread count to 5 to mach ActiveRecord's default. It sets the default environment to `"development"` and the default port to 300 so that booting the server with `$ puma` will give you the same default port as `rails server`. It is worth mentioning that by reading in from `PORT` environment variable this config can work with containerized deployments, such as on Heroku. We are not using worker processes by default, that way JRuby and windows devs can use this configuration without modification. I went ahead and included a default `on_worker_boot`. It won't be used unless a worker count is specified, that means this config will not use it. Even though it's not being used now It will make someone who wants to try modifying their config to run extra workers easier. cc/ @pixeltrix
* | | Merge pull request #23381 from matthewd/uneventful-redisMatthew Draper2016-02-021-3/+0
|\ \ \ | |_|/ |/| | Redis sans EventMachine
| * | Switch the default redis adapter to a single-stream modelMatthew Draper2016-02-011-3/+0
| | | | | | | | | | | | | | | | | | This new adapter does get a little more intimate with the redis-rb gem's implementation than I would like, but it's the least bad of the approaches I've come up with.
* | | make rake proxy work in rails enginesyuuji.yaginuma2016-01-312-5/+5
|/ /
* | Add an after_bundle callback in Rails plugin templatesRyan Manuel2016-01-282-2/+31
| |
* | Introduce new welcome page for new projectsGenadi Samokovarov2016-01-262-3/+4
| | | | | | | | As requested by David in 23233.
* | Merge pull request #23212 from vipulnsward/bin-railsKasper Timm Hansen2016-01-249-95/+96
|\ \ | | | | | | Be consistent in testing outputs from railties test and use /bin/rails
| * | Be consistent in testing outputs from railties test and use /bin/rails ↵Vipul A M2016-01-249-95/+96
| | | | | | | | | | | | | | | | | | everywhere(the default behaviour now) instead of mix of /bin/rake /bin/rails everywhere [Ryo Hashimoto & Vipul A M]
* | | Pare back default `index` option for the migration generatorPrathamesh Sonpatki2016-01-243-30/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Using `references` or `belongs_to` in migrations will always add index for the referenced column by default, without adding `index:true` option to generated migration file. - Users can opt out of this by passing `index: false`. - Legacy migrations won't be affected by this change. They will continue to run as they were before. - Fixes #18146
* | | Rails::Generators::Actions#gem should work even if frozen string is passed ↵Prathamesh Sonpatki2016-01-241-0/+8
|/ / | | | | | | | | | | as argument - Fixes #23137.
* / prevent --skip-action-cable from erroring when --api option is usedDave Riddle2016-01-221-0/+12
|/
* remove `per_form_csrf_tokens` initializer from Rails APIyuuji.yaginuma2016-01-221-0/+1
| | | | | Because the form is not in the Rails API, `per_form_csrf_tokens` initializer I think unnecessary.
* Merge pull request #23174 from JuanitoFatas/followup-skip-action-cableKasper Timm Hansen2016-01-221-0/+3
|\ | | | | Remove action_cable_meta_tag when skip Action Cable
| * Remove action_cable_meta_tag when skip action_cableJuanitoFatas2016-01-221-0/+3
| |
* | Add `config/cable.yml` to list of default files in Rails generatorJon Moss2016-01-211-0/+1
|/
* Merge pull request #23078 from ↵Rafael França2016-01-211-0/+4
|\ | | | | | | | | y-yagi/add_application_mailer_rb_to_mountable_engine add application_mailer.rb to template of mountable engine
| * allow symbol to end of string in `wrap_in_modules`yuuji.yaginuma2016-01-161-4/+4
| |
| * add application_mailer.rb to template of mountable engineyuuji.yaginuma2016-01-151-0/+4
| | | | | | | | | | since 9446e38ba47c9ca3be2ad668d8a8bea0141be6fc, generated mailer inherents from ApplicationMailer, ApplicationMailer is required in the mountable engine.
* | Merge pull request #22950 from maclover7/adapterize-storage-actioncableMatthew Draper2016-01-201-1/+11
|\ \ | | | | | | | | | Adapterize storage for ActionCable
| * | Add em-hiredis and redis as default Gems for new applicationsJon Moss2016-01-181-0/+10
| | |
| * | Adapterize ActionCable storage and extract behaviorJon Moss2016-01-181-1/+1
| | |
* | | Remove incomplete filter runs all tests in plugins.Kasper Timm Hansen2016-01-181-8/+0
| | | | | | | | | | | | Forgot to remove it, when I changed the expectations in 88881d2.
* | | Don't run all tests when files end in a colon.Kasper Timm Hansen2016-01-181-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If running `bin/rails t test/models/bunny_test.rb:` we'd implicitly run all the tests in the bunny test. I now highly doubt that people would ever put in a line filter without a line *and* want that to mean run all tests in that file. Instead, change regex to require a line digit after the colon, so runs without a line at the end would fail to require the test file. This also has the side benefit of breaking requiring a file with many colons: `bin/rails t test/models/bunny_test.rb:::::::::::::4` Think this means I've had enough colonoscopy to last me through the year :)
* | | Merge pull request #23006 from Edouard-chin/code_statistic_ignore_hidde_filesKasper Timm Hansen2016-01-181-1/+14
|\ \ \ | |/ / |/| | CodeStatistic will now ignore hidden files:
| * | CodeStatistic will now ignore hidden files:Edouard CHIN2016-01-181-1/+14
| | | | | | | | | | | | - Modify the default regex to not match hidden files
* | | Avoid multiple default paths to server.pid fileTawan Sierek2016-01-161-0/+9
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix bug (#22811) that occurs when rails server is started in daemon mode and optional path to the `server.pid` file is omitted. Store default path in a constant instead of evaluating it multiple time using `File.expand_path`. The bug in detail: The server startup procedure crashes, since it tries to open a file at `/tmp/pids/server.pid` instead of `<path to project>/tmp/pids/server.pid`. This bug was introduced in 51211a94bd when Rack was upgraded from version 1.x to 2.x. Since version 2.x, Rack does not memoize the options hash [1], and as a consequence `Rails::Server#default_options` will be evaluated multiple times. The hash returned by `Rails::Server#default_options` holds the default path to the `server.pid` file. The path is generated with the method `File.expand_path`. However, the return value of this method depends on the current working directory [2], which changes once `Process.daemon` is invoked by `Rack::Server#daemonize_app` and the process is detached from the current shell. Close #22811 [1]https://git.io/vzen2 [2]http://ruby-doc.org/core-2.1.5/File.html#method-c-expand_path
* | bring back `TEST` env for `rake test`.Yves Senn2016-01-121-0/+11
| | | | | | | | | | | | | | Closes #23027. This does not restore complete backwards compatibility. It simply passes the contets of the `TEST` env to the new runner.
* | remove warnings from rake testyuuji.yaginuma2016-01-111-2/+2
|/ | | | | | | | | This removes the following warnings. ``` test/application/rake_test.rb:33: warning: ambiguous first argument; put parentheses or a space even after `/' operator test/application/rake_test.rb:43: warning: ambiguous first argument; put parentheses or a space even after `/' operator ```
* Added multiple line filters support for test runnerSiva Gollapalli2016-01-101-0/+78
|
* rake log:clear task updated refs[#22544]Pramod2016-01-091-3/+3
| | | | | | | | - Avoided truncating all files if no ENV['LOGS'] specified - Updated task to accept LOGS=all for truncating all files from log/ i.e. log/*log - If no LOGS specified will truncates standard environment log files i.e. 'development,test,production' - CHANGELOG & guide update added - bin/setup test cases fixed
* Merge pull request #22967 from schneems/schneems/generic-metadataSean Griffin2016-01-084-7/+27
|\ | | | | Prevent destructive action on production database