Sha256: f7a9de931f975bf65c5ebbbc50628098d0ce0a85755f8a3988075eb780e683e0

Contents?: true

Size: 485 Bytes

Versions: 62

Compression:

Stored size: 485 Bytes

Contents

require 'test_helper'

module Mongoid
  class FindOrderedTest < Workarea::TestCase
    class FooModel
      include Mongoid::Document
    end

    def test_find_ordered
      models = [FooModel.create!, FooModel.create!, FooModel.create!]
      results = FooModel.find_ordered(models.map(&:id).reverse)
      assert_equal(models.reverse, results)
      results = FooModel.find_ordered(models.map(&:id).map(&:to_s).reverse)
      assert_equal(models.reverse, results)
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.4.27 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.5.4 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.26 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.5.3 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.25 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.5.2 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.24 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.5.1 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.23 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.22 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.5.0 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.21 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.5.0.beta.1 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.20 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.19 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.18 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.17 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.16 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.15 test/lib/workarea/ext/mongoid/find_ordered_test.rb
workarea-core-3.4.14 test/lib/workarea/ext/mongoid/find_ordered_test.rb