* In current database.yml config, all database environments are sharing same database. Suffix database name with relevant environment name to ensure database uniqueness
* Update Rails migration command to `db:drop:all` and `db:create:all`, so all db listed in config/database.yml is dropped/created accordingly
* Write a base ActiveRecord model that connects to different database (production database)
* Write a base ActiveRecord model that connects to default database (development database), this is a dummy model, just for symmetry's sake
* Add Rails 6 appraisal to start testing against it.
* Fix usage of Module#parent as this is deprecated in Rails 6 in favor
of Module#module_parent.
* Ensure that we're using the correct version of `sqlite3` and `pg` at
all times
* When creating classes within tests, ensure that they are removed
correctly
* Fix detection of has_secure_password in models: Check that
InstanceMethodsOnActivation is specifically defined, as Rails 6 no
longer has such a module.
Co-authored-by: Lee Machin <me@mrl.ee>
[Bootsnap][1] is a new gem that speeds up load times for Rails apps and
is included by default in Rails 5.2+ apps. However, this somehow messes
with Zeus, which we use often to run tests locally. We don't need it in
the Rails apps that the tests generate, so make sure it's not required
in those apps.
[1]: https://github.com/Shopify/bootsnap
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.
debugger and byebug cannot be present in Appraisals because they only
work on specific Ruby versions, and we test against a range of Ruby
versions. Hence, they can't be present in the Rails application that
gets generated in acceptance tests, either.
Also, we don't really need web-console to be there, it's just an extra
dependency.
* Change 'spec' Rake task to 'spec:unit'
* Require unit_spec_helper.rb in unit tests, not spec_helper.rb
* Re-namespace files in spec/support/unit under UnitTests
* Files in spec/support/unit/helpers no longer automatically add
themselves to RSpec - this happens in unit_spec_helper.rb
* Extract RecordWithDifferentErrorAttributeBuilder and
RecordValidatingConfirmationBuilder to separate files
* Move spec/shoulda to spec/unit_tests/shoulda
* Move spec/support/*.rb to spec/support/unit_tests/{helpers,matchers}
* Move spec_helper.rb to unit_spec_helper.rb
2014-11-04 14:43:59 -07:00
Renamed from spec/support/test_application.rb (Browse further)