aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/rake_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Protect from forgery by defaultLisa Ugray2017-07-101-1/+1
| | | | | | | | Rather than protecting from forgery in the generated ApplicationController, add it to ActionController::Base by config. This configuration defaults to false to support older versions which have removed it from their ApplicationController, but is set to true for Rails 5.2.
* Move test related to `tmp:clear` task to `tmp_test.rb`yuuji.yaginuma2017-07-021-7/+0
|
* 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
|
* Fix style guide violationsRafael Mendonça França2017-01-051-1/+0
|
* Remove test to the db:test:cloneRafael Mendonça França2017-01-031-10/+0
|
* Remove deprecated CONTROLLER environment variable for routes taskRafael Mendonça França2017-01-031-42/+25
|
* Use YAML to serialize schema cacheKir Shatrov2016-11-271-2/+2
|
* Add missing test for singular resource output in rake routesPrathamesh Sonpatki2016-11-191-0/+20
| | | | | | | | - This test was present in https://github.com/rails/rails/pull/27089 but not present on master, may be removed in merge commit? - There was discussion about moving this to `application/rake_test` so may be this happened in merge commit. - https://github.com/rails/rails/pull/27089#discussion_r88731157
* Fix incorrect output from rails routes when using singular resources issue ↵Erick Reyna2016-11-181-3/+3
| | | | | | | | | | #26606 Rails routes (even rake routes in previous versions) output showed incorrect routes when an application use resource :controller, implying that edit_controller_path match with controller#show. The order of the output has changed to correct this. View #26606 for more information. Added a test case, change unit test in rake to expect the new output. Since the output of resource :controller is changing, the string spected of the railties/test/application/rake_test.rb test_rails_routes_with_controller_environment had to be modified.
* Add three new rubocop rulesRafael Mendonça França2016-08-161-16/+16
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies new string literal convention in railties/testXavier 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.
* Remove unused boot_rails method and it's usagePrathamesh Sonpatki2016-07-041-1/+0
| | | | | - The `boot_rails` method from abstract_unit.rb is empty after 2abcdfd978fdcd491576a237e8c6b. - So let's remove it and its usage.
* Fix assertion count after 69e1bb52.Kasper Timm Hansen2016-05-281-2/+2
| | | | | | | | | | | | | | | When changing the generated integration tests to assert redirects with an absolute path this redirection check in `assert_redirected_to` against the absolute response location would now pass: https://github.com/rails/rails/blob/af245aaf3a1c447752a1b5895adddc66e5f73c00/actionpack/lib/action_dispatch/testing/assertions/response.rb#L55 Thus we'd break early instead of hitting `assert_operator` and have 2 fewer assertions per `assert_redirected_to` as `assert_operator` is composed of 2 assertions internally: https://github.com/seattlerb/minitest/blob/4e146b1515b19a5c474e39c174b037510f6dbc6e/lib/minitest/assertions.rb#L254-L258 Deduct 2 assertions for 2 redirects taking the expected count down by 4 in total for the two failing tests.
* Merge pull request #24696 from y-yagi/remove_unnessary_option_settingKasper Timm Hansen2016-04-251-0/+11
|\ | | | | remove unnessary option setting from test runner
| * register rake options to `OptionParser`yuuji.yaginuma2016-04-251-0/+11
| | | | | | | | | | In order to prevent `OptionParser::ParseError` when specify the rake options to `routes` task.
* | Fix broken build, channel files are also included in `bin/rails stats` nowPrathamesh Sonpatki2016-04-241-2/+2
|/ | | | - Followup of https://github.com/rails/rails/pull/24709.
* Fix indentation [ci skip]Ryuta Kamizono2016-03-051-1/+1
| | | | Follow up to #24050.
* making a test definition more clear.Mohit Natoo2016-03-041-1/+1
|
* [ci skip] using correcting test case names specifying `rails routes` instead ↵Mohit Natoo2016-03-041-6/+6
| | | | of `rake routes`
* convert cable.coffee to cable.jsyuuji.yaginuma2016-02-281-1/+1
| | | | In order to eliminate the dependecy of CoffeeScript.
* The tasks in the rails task namespace is deprecated in favor of app namespace.Ryo Hashimoto2016-02-261-2/+2
| | | | (e.g. `rails:update` and `rails:template` tasks is renamed to `app:update` and `app:template`.)
* Enable Action Cable routes by defaultJon Moss2016-02-241-1/+1
| | | | This also marks Action Cable routes as internal to Rails.
* Merge pull request #23611 from abhishekjain16/routes_optionsKasper Timm Hansen2016-02-121-1/+9
|\ | | | | Fix routes to match verb and URL path with -g option also.
| * Fixes routes to match verbs and path with -g optionAbhishek Jain2016-02-111-1/+9
| |
* | set association name to generated fixtures if attribute is referenceyuuji.yaginuma2016-02-061-5/+4
|/ | | | | | | 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
* 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.
* 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]
* Be consistent in testing outputs from railties test and use /bin/rails ↵Vipul A M2016-01-241-31/+31
| | | | | | everywhere(the default behaviour now) instead of mix of /bin/rake /bin/rails everywhere [Ryo Hashimoto & Vipul A M]
* 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 ```
* Merge pull request #22967 from schneems/schneems/generic-metadataSean Griffin2016-01-081-0/+20
|\ | | | | Prevent destructive action on production database
| * Prevent destructive action on production databaseschneems2016-01-071-0/+20
| | | | | | | | | | | | | | This PR introduces a key/value type store to Active Record that can be used for storing internal values. It is an alternative implementation to #21237 cc @sgrif @matthewd. It is possible to run your tests against your production database by accident right now. While infrequently, but as an anecdotal data point, Heroku receives a non-trivial number of requests for a database restore due to this happening. In these cases the loss can be large. To prevent against running tests against production we can store the "environment" version that was used when migrating the database in a new internal table. Before executing tests we can see if the database is a listed in `protected_environments` and abort. There is a manual escape valve to force this check from happening with environment variable `DISABLE_DATABASE_ENVIRONMENT_CHECK=1`.
* | ApplicationMailer should be generated by default just like every other ↵David Heinemeier Hansson2015-12-171-1/+1
| | | | | | | | Application* parent
* | Merge pull request #22567 from gsamokovarov/introduce-application-recordRafael França2015-12-161-1/+1
|\ \ | |/ |/| Introduce ApplicationRecord, an Active Record layer supertype
| * Introduce ApplicationRecord, an Active Record layer supertypeGenadi Samokovarov2015-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's pretty common for folks to monkey patch `ActiveRecord::Base` to work around an issue or introduce extra functionality. Instead of shoving even more stuff in `ActiveRecord::Base`, `ApplicationRecord` can hold all those custom work the apps may need. Now, we don't wanna encourage all of the application models to inherit from `ActiveRecord::Base`, but we can encourage all the models that do, to inherit from `ApplicationRecord`. Newly generated applications have `app/models/application_record.rb` present by default. The model generators are smart enough to recognize that newly generated models have to inherit from `ApplicationRecord`, but only if it's present.
* | Run railties generated app tests in test enveileencodes2015-12-151-3/+3
|/ | | | | | | | | | | | | | | | | | Running railties generated app tests in development env can cause unintended consequences. The environments are different and tests aren't meant to be run in development mode. The changes to the generator exposed this issue where the random test order in the generated apps could cause problems when those tests are run in development mode. Particularly we saw failures in `railties/test/application/rake_test.rb` generated apps that used the scaffold to create applications and then run the migration and immediately run the tests. The error we saw was `ActiveRecord::RecordNotFound: Couldn't find User with 'id'=980190962` and seemed to only occur if the destroy test ran first. I'm not entirely sure _why_ this causes that error to be thrown but I believe it is related to the environments being different.
* File encoding is defaulted to utf-8 in Ruby >= 2.1Akira Matsuda2015-09-181-1/+0
|
* tests, railties tests should use `bin/` executables when possible.Yves Senn2015-06-301-37/+37
| | | | | We recommend using the `bin/` executables in our docs and guides. Let's make sure that our tests execute the same code path.
* Fix failing tests for Rails-APISean Griffin2015-06-111-1/+1
| | | | This looks to be just out of sync tests
* config.api_only = true implies config.generators.api_only = trueSantiago Pastorino2015-06-111-1/+0
|
* API apps scaffold generator generates an apropriate controllerSantiago Pastorino2015-06-111-0/+20
|
* Add test to ensure tmp:clear works when tmp is missingYoong Kang Lim2015-05-301-0/+7
| | | | See #20299.
* Removed `assigns` from functional_test templatesPrathamesh Sonpatki2015-05-021-2/+2
| | | | | - Based on DHH's suggestion about deprecating `assigns` in https://github.com/rails/rails/pull/18305#issuecomment-68605166.
* Add explicit base class for ActiveJob jobsJeroen van Baarsen2015-03-231-1/+1
| | | | | | | | * Jobs generated now inherent from ApplicationJob * ApplicationJob inherents from ActiveJob::Base * Added entry to changelog Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* Require `belongs_to` by default.Josef Šimánek2015-02-211-1/+4
| | | | Deprecate `required` option in favor of `optional` for belongs_to.
* Use `SCHEMA` instead of `DB_STRUCTURE` for specifiying structure file.Dieter Komendera2015-01-081-1/+1
| | | | | `rake test:load_structure` already uses `SCHEMA` and there's no need to maintain two different env vars.
* Make the rails:template rake task load initializersRobin Dupret2014-03-081-0/+11
| | | | | | | | | | | Templates could rely on irregular inflections or external libraries for instance so we should load the application's initializers when running the rails:template task. The introducing commit of this feature is f7f11361 ; the initializers have never been loaded invoking this task. Fixes #12133.
* Automatically maintain test database schemaJon Leighton2014-01-021-2/+2
| | | | | | | | | | | | | | * Move check from generated helper to test_help.rb, so that all applications can benefit * Rather than just raising when the test schema has pending migrations, try to load in the schema and only raise if there are pending migrations afterwards * Opt out of the check by setting config.active_record.maintain_test_schema = false * Deprecate db:test:* tasks. The test helper is now fully responsible for maintaining the test schema, so we don't need rake tasks for this. This is also a speed improvement since we're no longer reloading the test database on every call to "rake test".
* Regression test for load_structure and clone_structureArthur Neves2013-12-141-2/+4
|
* Build fix for new routing inspector changesArun Agrawal2013-11-221-2/+2
| | | | | | Broken by 6701b4cf41f6f3d9cfc6a93715acbf852d1e468e