Commit Graph

18 Commits

Author SHA1 Message Date
Edouard Chin 2b479a7f08 Support rails 6.0.0 (#1172)
* Change update_attributes to update

In Rails 6.0 update_attributes/update_attributes! is considered deprecated. Method update/update! is the replacement.

* CI: Don't use Bundler 1.16.1

- Bundler 1.16.1 has bug where dependencies can't be resolved properly
  when a gem is a release candidate or an alpha version.
  The underlying bundler issue can be found here https://github.com/bundler/bundler/issues/6449

* Disable eager_load in test env:

- In Rails 6.0, rails/rails@3b95478 made a change to eagerly define
  attribute methods of a Model when `eager_load` is enabled.
  This breaks our test suite because of the way we run migration.

  The TL;DR is that doing `People.attribute_names` will return an
  empty array instead of `[:id, time_zone, ...]`.
  You can find a failing build here https://travis-ci.org/paper-trail-gem/paper_trail/jobs/463369634

  Basically what happens is:

  1) The dummy app boot, attribute methods of each model are defined
     but since migration didn't run yet, the tables aren't even
     created resulting in a empty attribute set.
  2) Migration runs, but it's already too late.

  In this commit I disabled eager_loading in test, AFAIT there isn't
  much benefit in eager_loading the dummy app anyway.
  Also renaming the `user.rb` file to `postgres_user.rb` in order for
  rails autoloading to work correctly.
2018-12-04 16:10:35 -05:00
Jared Beck ffdb9df3b3 Various improvements to json_version_spec 2018-06-10 13:15:59 -04:00
Jared Beck cfbf7a647c Lint: Style/FrozenStringLiteralComment 2017-12-10 23:05:39 -05:00
Jared Beck 38fa23873c Merge rails_helper into spec_helper
The reason some projects have both is so that some spec files can be
run in isolation, without the rails stuff. In practice, I don't find
myself ever doing this. So, the complexity of two files is unnecessary.
2017-05-30 00:59:55 -04:00
Jared Beck e2505c4f30 rubocop 0.48.1 (was 0.48.0) 2017-05-21 02:40:23 -04:00
Jared Beck af10cd4f00 Lint: Fix RSpec/ExampleWording 2017-04-01 01:50:13 -04:00
Jared Beck fc071b2d13 rubocop 0.41.1 (was 0.40.0) 2016-06-27 03:02:33 -04:00
Jared Beck c7fe611907 Fix Style/PercentLiteralDelimiters 2016-03-05 17:22:29 -05:00
Jared Beck 8980f08d0e Fix Style/StringLiterals: Use double quotes 2016-03-05 17:07:32 -05:00
Jared Beck 10941c8459 Fix Style/HashSyntax 2016-02-15 22:32:40 -05:00
Jared Beck 78009a5b8e Fix Style/EmptyLinesAroundBlockBody 2016-02-15 22:22:12 -05:00
Jared Beck 033b13504a Bind parameters in where_object{,_changes}
[Fixes #696]
2016-01-18 15:17:25 -05:00
Jared Beck f4cf6c16db Simplify test data: fruit names
It's not clear to me that random test data makes this particular
test better.
2015-12-19 21:16:25 -05:00
Jared Beck 811dc0ed47 Hopefully fix intermittent PG test fail in CI
Test would fail when FFaker::Color.name returned the same exact
string twice in a row. This is not FFaker's fault.

Incidentally, the FFaker color list currently has 19 entries.
(https://github.com/ffaker/ffaker/blob/master/lib/ffaker/data/color/names_list)
The test suite runs this postgres-specific test six times (3 rubies * 2 major
versions of rails). So, I think the chance of the test suite failing was
(1 / 19)^2 * 6, or 0.016, or about 2%.
2015-12-19 21:13:30 -05:00
Jared Beck 86f8c5dd33 ffaker 2.1 (was 1.31) 2015-12-19 19:02:31 -05:00
Jared Beck 59cae397d8 Fix NameError: uninitialized constant JsonVersion 2015-11-17 23:59:35 -05:00
Ben Atkins 916b78897b Only execute the JsonVersion tests against ActiveRecord4 since there is no ActiveRecord3 support for it 2015-05-07 14:56:28 -04:00
Ben Atkins 7834309857 Add test cases explicitly surrounding JSON type columns when the test suite is executed against Postgres 2015-05-06 22:29:39 -04:00