Skip to content

Instantly share code, notes, and snippets.

@arthurnn
Created November 29, 2013 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save arthurnn/7712730 to your computer and use it in GitHub Desktop.
Save arthurnn/7712730 to your computer and use it in GitHub Desktop.
Another failing test on rails 4.
require 'active_record'
require 'minitest/autorun'
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: 'foobar.db'
class Record < ActiveRecord::Base
connection.create_table table_name, force: true do |t|
t.string :name
end
end
class Foo < ActiveRecord::Base
connection.create_table table_name, force: true do |t|
t.string :name
t.belongs_to :record
end
belongs_to :record
end
class Test < MiniTest::Unit::TestCase
def test_ar
rec = Record.create!(name: 'record')
foo = Foo.create!(name: 'foo', record: rec)
assert_equal 1, Record.count
assert 1, Foo.count
end
end
@senny
Copy link

senny commented Nov 29, 2013

for reference rails/rails#11645

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment