Created
November 29, 2013 22:21
-
-
Save arthurnn/7712730 to your computer and use it in GitHub Desktop.
Another failing test on rails 4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for reference rails/rails#11645