Skip to content
This repository
Browse code

Fix test

Oops. We need to estalish/remove the connection in the setup/teardown,
else it messes with the fixtures.
  • Loading branch information...
commit 4642f5487a491de283910c662a519f14c21e136f 1 parent cb8c950
Jon Leighton jonleighton authored

Showing 1 changed file with 8 additions and 1 deletion. Show diff stats Hide diff stats

  1. +8 1 activerecord/test/cases/invalid_connection_test.rb
9 activerecord/test/cases/invalid_connection_test.rb
@@ -4,9 +4,16 @@ class TestAdapterWithInvalidConnection < ActiveRecord::TestCase
4 4 self.use_transactional_fixtures = false
5 5
6 6 class Bird < ActiveRecord::Base
  7 + end
  8 +
  9 + def setup
7 10 # Can't just use current adapter; sqlite3 will create a database
8 11 # file on the fly.
9   - establish_connection adapter: 'mysql', database: 'i_do_not_exist'
  12 + Bird.establish_connection adapter: 'mysql', database: 'i_do_not_exist'
  13 + end
  14 +
  15 + def teardown
  16 + Bird.remove_connection
10 17 end
11 18
12 19 test "inspect on Model class does not raise" do

0 comments on commit 4642f54

Please sign in to comment.
Something went wrong with that request. Please try again.