Sha256: 64bb55148d096a109cb84e82bc7082db85b1b27acd1fd7beb9483a41c9b6f941

Contents?: true

Size: 472 Bytes

Versions: 2

Compression:

Stored size: 472 Bytes

Contents

module RSpecExtensionsCollection
  module Matchers
    module MongoidModelHelpers
  
      # Mongoid executes query only when it's needed. Until then, it just creates Criteria object. 
      # For the purpose of test, this method gets the result models array from Criteria object as usually done in for loop in view.
      def execute_query_to_models(result_array_mongoid_criteria)
        result_array_mongoid_criteria.map { |model| model }
      end
  
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspec_extensions_collection-0.0.4 lib/rspec_extensions_collection/helpers/mongoid_model_helpers.rb
rspec_extensions_collection-0.0.3 lib/rspec_extensions_collection/helpers/mongoid_model_helpers.rb