1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
Commit graph

12 commits

Author SHA1 Message Date
Pedro Paiva
0b23942feb Add have_rich_text_matcher
The `have_rich_text` matcher tests usage of the `has_rich_text` macro that was added in Rails 6.
2020-01-23 09:29:57 -07:00
Joey Cheng
7dd35a4460 Configure database for multi-db testing
* 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
2019-05-23 21:57:21 -06:00
Elliot Winkler
ae9bf4a735 Add minimal support for Rails 6
* 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>
2019-04-22 00:10:18 -04:00
Elliot Winkler
0f36e3c5c0 Don't require bootsnap in gen'ed Rails 5.2+ apps
[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
2018-09-12 20:25:31 -06:00
Elliot Winkler
e31537dcb6 Squiggly heredoc is not supported in Ruby 2.2 2017-09-17 17:01:50 -05:00
Elliot Winkler
76e63b2638 Rails 5: Fix validate_inclusion_of tests 2017-09-17 17:01:50 -05:00
Michael Deering
d7ac9cb970 Do not apply .railsrc 2016-01-06 10:21:43 -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
Elliot Winkler
d7f7f58637 Remove debugger, byebug, and web-console from 4.2
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.
2015-02-05 10:22:12 -07:00
Elliot Winkler
366026b937 Fix unit tests to use new acceptance stuff 2014-11-05 09:53:53 -07:00
Elliot Winkler
f922613386 Reorganize unit tests, part II
* 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
2014-11-05 09:53:20 -07:00
Elliot Winkler
bbdf8a807e Reorganize unit tests, part I
* 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)