aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix `rails initializers --help` and `rails dev:cache --help`bogdanvlviv2018-08-222-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | - `rails initializers --help` should show description set by `desc` See railties/lib/rails/command/base.rb:27 - Fix `rails dev:cache --help` ``` Traceback (most recent call last): 10: from bin/rails:4:in `<main>' 9: from bin/rails:4:in `require' 8: from /work/rails/railties/lib/rails/commands.rb:18:in `<top (required)>' 7: from /work/rails/railties/lib/rails/command.rb:46:in `invoke' 6: from /work/rails/railties/lib/rails/command/base.rb:65:in `perform' 5: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch' 4: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command' 3: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run' 2: from /work/rails/railties/lib/rails/command/base.rb:150:in `help' 1: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:170:in `command_help' /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/base.rb:497:in `handle_no_command_error': Could not find command "dev". (Thor::UndefinedCommandError) ``` Context https://github.com/rails/rails/pull/33694#issuecomment-415127304 Would be great to set a description to other commands.
* Merge pull request #33162 from utilum/stop_using_mochaKasper Timm Hansen2018-08-2211-59/+200
|\ | | | | Stop using Mocha
| * Remove Mocha from Gemfileutilum2018-08-132-6/+0
| | | | | | | | _Q.E.F._
| * Add method_call_assertions and use them instead of Mochautilum2018-08-136-36/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Six Mocha calls prove quite resistant to Minitestification. For example, if we replace ``` ActiveRecord::Associations::HasManyAssociation .any_instance .expects(:reader) .never ``` with `assert_not_called`, Minitest wisely raises ``` NameError: undefined method `reader' for class `ActiveRecord::Associations::HasManyAssociation' ``` as `:reader` comes from a deeply embedded abstract class, `ActiveRecord::Associations::CollectionAssociation`. This patch tackles this difficulty by adding `ActiveSupport::Testing::MethodCallAsserts#assert_called_on_instance_of` which injects a stubbed method into `klass`, and verifies the number of times it is called, similar to `assert_called`. It also adds a convenience method, `assert_not_called_on_instance_of`, mirroring `assert_not_called`. It uses the new method_call_assertions to replace the remaining Mocha calls in `ActiveRecord` tests. [utilum + bogdanvlviv + kspath]
| * Stub with Minitest and test with MethodCallAssertionsutilum2018-08-133-17/+30
| |
* | Partly revert unused accessorRyuta Kamizono2018-08-231-8/+1
| | | | | | | | This was introduced at 24f6bf0d96b58f2b2ef6a886c93d35cf8ce4f293.
* | Merge pull request #33691 from tgxworld/add_config_to_disable_advisory_locksMatthew Draper2018-08-238-4/+75
|\ \ | | | | | | Add database configuration to disable advisory locks.
| * | Add database configuration to disable advisory locks.Guo Xiang Tan2018-08-228-4/+75
| | | | | | | | | | | | https://github.com/rails/rails/issues/31190
* | | Merge pull request #33547 from Ana06/patch-1Matthew Draper2018-08-233-3/+34
|\ \ \ | | | | | | | | | | | | Use public_send in value_for_collection
| * | | Add tests for privates methods in view's helpersAna María Martínez Gómez2018-08-082-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test that using private methods in `options_from_collection_for_select` is deprecated. Make the unused `secret` paramether in the `Post` Struct private to use it in the test.
| * | | Deprecate use of private methods in view's helpersAna María Martínez Gómez2018-08-082-4/+14
| | | | | | | | | | | | | | | | | | | | Instead of dropping it completely in case someone is relying (probably inadvertenly) on it.
| * | | Add one more method affected in CHANGELOGAna María Martínez Gómez2018-08-081-2/+3
| | | |
| * | | Use public_send in extract_values_from_collectionAna María Martínez Gómez2018-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid exposing private methods in view's helpers. However, as `extract_values_from_collection` is only called from `options_from_collection_for_select` where `value_for_collection` is previously called, this case was already covered. The change makes anyway sense for consistency and in case the code changes in the future.
| * | | Use public_send in value_for_collectionAna María Martínez Gómez2018-08-072-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | Avoid exposing private methods in view's helpers. Fixes https://github.com/rails/rails/issues/33546
* | | | Merge pull request #33659 from palkan/feature/action-cable-testingEileen M. Uchitelle2018-08-228-0/+343
|\ \ \ \ | |_|/ / |/| | | [WIP] Action cable testing
| * | | Add Action Cable test case and test helperVladimir Dementyev2018-08-195-0/+255
| | | |
| * | | Add Action Cable test adapterVladimir Dementyev2018-08-193-0/+88
| | | |
* | | | Remove duplicate testutilum2018-08-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This patch corrects a duplicate method name introduced in #33635. Also fixes typo in method names.
* | | | Merge pull request #33682 from mroutis/brewfile-add-imagemagickRafael França2018-08-211-0/+1
|\ \ \ \ | | | | | | | | | | [ci skip] Add ImageMagick to Brewfile
| * | | | [ci skip] Add ImageMagick to BrewfileMr. Outis2018-08-211-0/+1
|/ / / / | | | | | | | | | | | | In order to run ActiveStorage's tests successfully, you need imagemagick
* | | | Show the `ENV` value correctly in the doc of `combined_fragment_cache_key` ↵yuuji.yaginuma2018-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip] It seems to need an escape for the showing `ENV`. https://api.rubyonrails.org/classes/AbstractController/Caching/Fragments.html#method-i-combined_fragment_cache_key
* | | | Add missing newline [ci skip]George Claghorn2018-08-211-0/+1
| | | |
* | | | Merge pull request #33680 from mroutis/update-guides-activestorage-dependenciesGeorge Claghorn2018-08-211-1/+13
|\ \ \ \ | | | | | | | | | | [ci skip] Add ImageMagick to ActiveStorage dependencies
| * | | | [ci skip] Add ImageMagick to ActiveStorage dependenciesMr. Outis2018-08-211-1/+13
|/ / / / | | | | | | | | | | | | | | | | In order to run ActiveStorage's tests successfully, you need imagemagick.
* | | | Merge pull request #29838 from fschwahn/patch-1Rafael França2018-08-212-0/+16
|\ \ \ \ | | | | | | | | | | Add usage of procs without arguments to callbacks guide
| * | | | Improve documentation of Procs as :if / :unless options for callbacksFabian Schwahn2018-08-202-0/+16
| | | | |
* | | | | Merge pull request #33660 from y-yagi/follow_up_32121Richard Schneeman2018-08-214-0/+58
|\ \ \ \ \ | | | | | | | | | | | | Make `rake routes` deprecate before deleting
| * | | | | Make `rake routes` deprecate before deletingyuuji.yaginuma2018-08-204-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `rake routes` was a public task. Therefore, I think that we should deprecate it before deleting it. Related to #32121.
* | | | | | Merge pull request #33635 from bogdanvlviv/improve-active_job-test_helpersJeremy Daer2018-08-204-61/+726
|\ \ \ \ \ \ | | | | | | | | | | | | | | Improve Active Job test helpers
| * | | | | | DRY in `assert_enqueued_jobs`bogdanvlviv2018-08-201-2/+6
| | | | | | |
| * | | | | | Fix formatting of `ActiveJob::TestHelper` api docsbogdanvlviv2018-08-201-4/+4
| | | | | | |
| * | | | | | Allow `assert_performed_with` to be called without a block.bogdanvlviv2018-08-203-14/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example: ``` def test_assert_performed_with MyJob.perform_later(1,2,3) perform_enqueued_jobs assert_performed_with(job: MyJob, args: [1,2,3], queue: 'high') end ``` Follow up #33626.
| * | | | | | Fix `assert_performed_jobs` and `assert_no_performed_jobs`bogdanvlviv2018-08-203-24/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Execution of `assert_performed_jobs`, and `assert_no_performed_jobs` without a block should respect passed `:except`, `:only`, and `:queue` options.
| * | | | | | Add changelog entry about adding `:queue` option to job assertions and helpersbogdanvlviv2018-08-201-13/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that it removes changelog entry of #33265 since the entry in this commits includes that too.
| * | | | | | Allow `:queue` option to `assert_no_performed_jobs`.bogdanvlviv2018-08-202-2/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the `:queue` option is specified, then only the job(s) enqueued to a specific queue will not be performed. Example: ``` def test_assert_no_performed_jobs_with_queue_option assert_no_performed_jobs queue: :some_queue do HelloJob.set(queue: :other_queue).perform_later("jeremy") end end ```
| * | | | | | Allow `:queue` option to `assert_performed_jobs`.bogdanvlviv2018-08-202-2/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the `:queue` option is specified, then only the job(s) enqueued to a specific queue will be performed. Example: ``` def test_assert_performed_jobs_with_queue_option assert_performed_jobs 1, queue: :some_queue do HelloJob.set(queue: :some_queue).perform_later("jeremy") HelloJob.set(queue: :other_queue).perform_later("bogdan") end end ```
| * | | | | | Fix `perform_enqueued_jobs`bogdanvlviv2018-08-201-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set ```` queue_adapter.perform_enqueued_jobs = true queue_adapter.perform_enqueued_at_jobs = true queue_adapter.filter = only queue_adapter.reject = except queue_adapter.queue = queue ``` if block given. Execution of `flush_enqueued_jobs` doesn't require that.
| * | | | | | Allow `:queue` option to `perform_enqueued_jobs`.bogdanvlviv2018-08-203-12/+168
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the `:queue` option is specified, then only the job(s) enqueued to a specific queue will be performed. Example: ``` def test_perform_enqueued_jobs_with_queue perform_enqueued_jobs queue: :some_queue do MyJob.set(queue: :some_queue).perform_later(1, 2, 3) # will be performed HelloJob.set(queue: :other_queue).perform_later(1, 2, 3) # will not be performed end assert_performed_jobs 1 end ``` Follow up #33265 [bogdanvlviv & Jeremy Daer]
* | | | | | Fix merging relation that order including `?`Ryuta Kamizono2018-08-212-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `Relation::Merger` has a problem that order values would be merged as nested array. That was caused an issue #33664 since if array value is passed to `order` and first element in the array includes `?`, the array is regarded as a prepared statement and bind variables. https://api.rubyonrails.org/classes/ActiveRecord/Sanitization/ClassMethods.html#method-i-sanitize_sql_for_order Just merging that as splat args like other values would fix the issue. Fixes #33664.
* | | | | | Merge pull request #33662 from yskkin/multi_word_routeRyuta Kamizono2018-08-202-23/+65
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix `rails routes -c` for controller name consists of multiple word.
| * | | | | | Fix `rails routes -c` for controller name consists of multiple word.Yoshiyuki Kinjo2018-08-202-23/+65
| | |_|/ / / | |/| | | |
* | | | | | Merge pull request #33652 from tgxworld/improve_tests_pool_configRyuta Kamizono2018-08-202-5/+50
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Improve tests for ActiveRecord::ConnectionAdapters::ConnectionPool co…
| * | | | | Speed up slow ConnectionPool test case.Guo Xiang Tan2018-08-201-11/+19
| | | | | |
| * | | | | Improve tests for ActiveRecord::ConnectionAdapters::ConnectionPool ↵Guo Xiang Tan2018-08-192-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | configurations.
* | | | | | Merge pull request #31132 from ↵Ryuta Kamizono2018-08-202-0/+10
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | emaxi/feature/add-missing-documentation-option-to-number-to-currency Add missing documentation option to number_to_currency [ci skip]
| * | | | | Add missing documentation options to number_to_currency [ci skip]emaxi2018-07-112-0/+10
| | | | | |
* | | | | | Merge pull request #33621 from sikachu/sikachu-guide-rubocopRichard Schneeman2018-08-191-2/+13
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | Update guide to mention code linters available
| * | | | | Update guide to mention code linters availablePrem Sichanugrist2018-08-151-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contributors can run RuboCop locally to catch code style error in Ruby code and npm lint task for `rails-ujs` CoffeeScript and JavaScript code. [skip ci]
* | | | | | Don't put up with not saying it.Kasper Timm Hansen2018-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Commands generally prefer say to puts.
* | | | | | Merge pull request #33657 from jychen7/fix-test-association-enumRyuta Kamizono2018-08-201-0/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | Improve test case to test enum correctly