1. 26 10月, 2018 1 次提交
    • B
      `assert_called_with` should require `args` argument · 9d0cf520
      bogdanvlviv 提交于
      There are two main reasons why `assert_called_with` should require
      `args` argument:
      
      1) If we want to assert that some method should be called and we don't
         need to check with which arguments it should be called then we should use
         `assert_called`.
      
      2) `assert_called_with` without `args` argument doesn't assert anything!
         ```ruby
         assert_called_with(@object, :increment) do
            @object.decrement
         end
         ```
         It causes false assertions in tests that could cause regressions in the project.
      
      I found this bug by working on
      [minitest-mock_expectations](https://github.com/bogdanvlviv/minitest-mock_expectations) gem.
      This gem is an extension for minitest that provides almost the same method call
      assertions.
      I was wondering whether you would consider adding "minitest-mock_expectations"
      to `rails/rails` instead of private `ActiveSupport::Testing::MethodCallAssertions` module.
      If yes, I'll send a patch - https://github.com/bogdanvlviv/rails/commit/a970ecc42c3a9637947599f2c13e3762e4b59208
      9d0cf520
  2. 25 10月, 2018 5 次提交
    • E
      Merge pull request #34309 from oliverguenther/patch-1 · a3dcba42
      Eileen M. Uchitelle 提交于
      Document `deep_interpolation` parameter for bulk lookups
      a3dcba42
    • O
      Document `deep_interpolation` parameter for bulk lookups · 4692ed7e
      Oliver Günther 提交于
      Bulk lookups are sort of an edge case, I have not heard of them until a colleague of mine decided to dynamically iterate over a growing set of translations and receiving them in bulk as a hash with `I18n.t 'welcome'` as in the example above.
      
      When passing an interpolation to these bulk lookups, they will only be performed when also passing `deep_interpolation: true`.
      
      **Without passing `deep_interpolation` flag:**
      ```ruby
      I18n.t 'welcome', app_name: 'book store'
      # => {:title=>"Welcome!", :content=>"Welcome to the %{app_name}"}
      
      **With passing `deep_interpolation`:**
      I18n.t 'welcome', deep_interpolation: true, app_name: 'book store'
      # => {:title=>"Welcome!", :content=>"Welcome to the book store"}
      ```
      
      I found this digging in the I18n lookup backend, the flag is listed on [I18n's Rubydoc](https://www.rubydoc.info/github/svenfuchs/i18n/master/I18n) but not otherwise listed. Since bulk lookups are mentioned here, I suggest to add a note with this flag along with it.
      4692ed7e
    • R
      Deterministic connection collation in tests · 3c000873
      Ryuta Kamizono 提交于
      The default collation for utf8mb4 is changed to utf8mb4_0900_ai_ci in
      MySQL 8.0, so `test_mysql_connection_collation_is_configured` is
      affected by MySQL version and/or default_collation_for_utf8mb4 system
      variable.
      
      https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_collation_for_utf8mb4
      
      ```
      % ARCONN=mysql2 be ruby -w -Itest test/cases/adapters/mysql2/connection_test.rb -n test_mysql_connection_collation_is_configured
      Using mysql2
      Run options: -n test_mysql_connection_collation_is_configured --seed 10421
      
      # Running:
      
      F
      
      Failure:
      Mysql2ConnectionTest#test_mysql_connection_collation_is_configured [test/cases/adapters/mysql2/connection_test.rb:108]:
      Expected: "utf8mb4_general_ci"
        Actual: "utf8mb4_0900_ai_ci"
      
      rails test test/cases/adapters/mysql2/connection_test.rb:106
      
      Finished in 0.013842s, 72.2450 runs/s, 144.4900 assertions/s.
      1 runs, 2 assertions, 1 failures, 0 errors, 0 skips
      ```
      3c000873
    • R
      Merge pull request #34204 from XrXr/aj-test-helper-args · d76d66fb
      Rafael França 提交于
      Include deserialized arguments in jobs returned by AJ test helpers
      d76d66fb
    • R
      Merge pull request #34303 from kamipo/lazy_checking_boundable · d3e64659
      Rafael França 提交于
      Lazy checking whether or not values in IN clause are boundable
      d3e64659
  3. 24 10月, 2018 11 次提交
  4. 23 10月, 2018 21 次提交
  5. 22 10月, 2018 2 次提交