1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

10 commits

Author SHA1 Message Date
Xavier Noria
80e66cc4d9 normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
Xavier Noria
9617db2078 applies new string literal convention in activerecord/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:26:53 +02:00
Yves Senn
4b1f67a11a tests, don't connect to mysql when running sqlite3 tests.
This resolves the following error:

```
Error:
TestAdapterWithInvalidConnection#test_inspect_on_Model_class_does_not_raise:
TypeError: superclass mismatch for class Mysql2Adapter
    /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:35:in `<module:ConnectionAdapters>'
    /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:34:in `<module:ActiveRecord>'
    /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:6:in `<top (required)>'
    /Users/senny/Projects/rails/activesupport/lib/active_support/dependencies.rb:302:in `require'
    /Users/senny/Projects/rails/activesupport/lib/active_support/dependencies.rb:302:in `block in require'
    /Users/senny/Projects/rails/activesupport/lib/active_support/dependencies.rb:268:in `load_dependency'
    /Users/senny/Projects/rails/activesupport/lib/active_support/dependencies.rb:302:in `require'
    /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:174:in `spec'
    /Users/senny/Projects/rails/activerecord/lib/active_record/connection_handling.rb:50:in `establish_connection'
    /Users/senny/Projects/rails/activerecord/test/cases/invalid_connection_test.rb:12:in `setup'
```
2015-12-28 09:00:38 +01:00
Abdelkader Boudih
fb24d0ed6c Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
Brandon Weiss
0965863564 Closes rails/rails#18864: Renaming transactional fixtures to transactional tests
I’m renaming all instances of `use_transcational_fixtures` to
`use_transactional_tests` and “transactional fixtures” to
“transactional tests”.

I’m deprecating `use_transactional_fixtures=`. So anyone who is
explicitly setting this will get a warning telling them to use
`use_transactional_tests=` instead.

I’m maintaining backwards compatibility—both forms will work.
`use_transactional_tests` will check to see if
`use_transactional_fixtures` is set and use that, otherwise it will use
itself. But because `use_transactional_tests` is a class attribute
(created with `class_attribute`) this requires a little bit of hoop
jumping. The writer method that `class_attribute` generates defines a
new reader method that return the value being set. Which means we can’t
set the default of `true` using `use_transactional_tests=` as was done
previously because that won’t take into account anyone using
`use_transactional_fixtures`. Instead I defined the reader method
manually and it checks `use_transactional_fixtures`. If it was set then
it should be used, otherwise it should return the default, which is
`true`. If someone uses `use_transactional_tests=` then it will
overwrite the backwards-compatible method with whatever they set.
2015-03-16 11:35:44 -07:00
Guo Xiang Tan
3baace687c Use teardown helper method.
Follow-Up to https://github.com/rails/rails/pull/14348

Ensure that SQLCounter.clear_log is called after each test.

This is a step to prevent side effects when running tests. This will allow us to run them in random order.
2014-03-14 20:48:59 -07:00
Arun Agrawal
539ce8b683 Changed message for Model.inspect
(No database connection) sounds not be
able to connect database.

see more #12804
2013-11-09 20:57:09 +01:00
Jon Leighton
4642f5487a Fix test
Oops. We need to estalish/remove the connection in the setup/teardown,
else it messes with the fixtures.
2013-06-28 11:46:03 +01:00
Jon Leighton
cb8c950333 Fix rake test_sqlite3_mem
Clearly nobody uses this except me. It's fast people!
2013-06-28 11:37:42 +01:00
Yves Senn
0f3aadae3b inspect for AR model classes does not initiate a new connection. 2013-06-20 07:21:04 +02:00