Permalink
Browse files

Fix test

Oops. We need to estalish/remove the connection in the setup/teardown,
else it messes with the fixtures.
  • Loading branch information...
jonleighton authored and carlosantoniodasilva committed Jun 28, 2013
1 parent fb86632 commit bb515e2b4a5e5f37fd8eb8dd43db6e6b16e52770
Showing with 8 additions and 1 deletion.
  1. +8 −1 activerecord/test/cases/invalid_connection_test.rb
@@ -4,9 +4,16 @@ class TestAdapterWithInvalidConnection < ActiveRecord::TestCase
self.use_transactional_fixtures = false
class Bird < ActiveRecord::Base
+ end
+
+ def setup
# Can't just use current adapter; sqlite3 will create a database
# file on the fly.
- establish_connection adapter: 'mysql', database: 'i_do_not_exist'
+ Bird.establish_connection adapter: 'mysql', database: 'i_do_not_exist'
+ end
+
+ def teardown
+ Bird.remove_connection
end
test "inspect on Model class does not raise" do

0 comments on commit bb515e2

Please sign in to comment.