Commit Graph

5 Commits

Author SHA1 Message Date
Elliot Winkler fb6ea7afd4 Fix tests for array columns
None of the tests around array columns were working because they weren't
actually creating models with array columns. This fixes that.
2019-07-14 18:28:19 -06:00
Elliot Winkler 4e2448d775 Teach have_db_index about expression indexes
In Rails 5, the schema layer was updated so that indexes could be
created on expressions rather that simply columns. Update
`have_db_index` so that you can test for this.

More reading: <edc2b77187>
2019-05-31 00:12:10 -06:00
Elliot Winkler a559713f96 Add a test for numericality + money columns
18b2859 and a0f1221 fixed the numericality matcher so that it no longer
raises CouldNotSetAttributeError when used against numeric columns.
Unfortunately, the issue still existed for money columns.

This is fixed now, but we never explicitly tested for money columns, and
this commit adds that test.
2016-01-10 00:10:24 -07:00
Elliot Winkler 6aeccd3c8e Uniqueness: Support PG array columns for scopes
Please note that array columns do not work properly between Rails 4.0
and 4.2.

* If you set an array-of-date or array-of-time attribute to an
  array, it will fail to hold that value. This is an issue with
  timestamp-aware attributes and is fixed in Rails 4.2.

* Even if this worked, the uniqueness validator cannot cope with array
  columns, producing an invalid query. This will be fixed in 4.1.10.
2015-02-13 16:33:26 -07:00
Elliot Winkler 72f60fae94 Add support for Postgres
When running tests, you can now switch between running them against a
SQLite or PostgreSQL database. This is accomplished by modifying the
unit and acceptance tests so that when they generate and load the test
Rails application, database.yml is replaced with content that will
configure the database appropriately.
2015-02-12 16:01:00 -07:00