Created
September 24, 2014 15:16
-
-
Save ffortin/04469945cc2e47a0c56c to your computer and use it in GitHub Desktop.
Test fails on store_accessor dup
This file contains 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 'bundler' | |
Bundler.setup(:default) | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
class Contact < ActiveRecord::Base | |
store_accessor :properties, :name, :phone | |
end | |
class BugTest < Minitest::Unit::TestCase | |
def test_hstore_accessor | |
p = Contact.new(name: 'Bob', phone: '123') | |
p2 = p.dup | |
assert_equal("Bob", p.name) #PASS | |
assert_equal("123", p.phone) #PASS | |
assert_equal("Bob", p2.name) #FAIL | |
assert_equal("123", p2.phone) #FAIL | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
p2.name, p2.phone => nil