Created
June 2, 2014 14:01
-
-
Save dblock/6d745fbdacddebb9ba65 to your computer and use it in GitHub Desktop.
Failing test for https://github.com/mongoid/mongoid/issues/3676.
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 'mongoid' | |
require 'mongoid/support/query_counter' | |
require 'minitest/autorun' | |
# Ensure backward compatibility with Minitest 4 | |
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test) | |
Mongoid.configure.connect_to("mongoid_test") | |
class Address | |
include Mongoid::Document | |
embedded_in :person | |
end | |
class Person | |
include Mongoid::Document | |
embeds_many :addresses | |
end | |
class BugTest < Minitest::Test | |
def test_pluck | |
person = Person.create! | |
person.addresses.create! | |
assert_equal [person.id], Person.all.pluck(:id) | |
assert_equal [person.addresses.first.id], person.addresses.pluck(:id) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment