-
-
Save pixeltrix/6009171 to your computer and use it in GitHub Desktop.
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
# Must have mysql installed with database 'activerecord_unittest' and user 'rails' | |
unless File.exists?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'mysql2' | |
GEMFILE | |
system 'bundle' | |
end | |
require 'bundler' | |
Bundler.setup(:default) | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
ActiveRecord::Base.establish_connection(adapter: 'mysql2', user: 'rails', database: 'activerecord_unittest') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
class BugTest < MiniTest::Unit::TestCase | |
def test_association_stuff | |
conn = ActiveRecord::Base.connection | |
c = ActiveRecord::ConnectionAdapters::Mysql2Adapter::Column.new(nil, 1, 'boolean') | |
assert_equal 1, conn.type_cast(true, c) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment