Module: RSpecExtensionsCollection::Matchers::MongoidModelHelpers
- Included in:
- SearchMatcher
- Defined in:
- lib/rspec_extensions_collection/helpers/mongoid_model_helpers.rb
Instance Method Summary collapse
-
#execute_query_to_models(result_array_mongoid_criteria) ⇒ Object
Mongoid executes query only when it’s needed.
Instance Method Details
#execute_query_to_models(result_array_mongoid_criteria) ⇒ Object
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.
7 8 9 |
# File 'lib/rspec_extensions_collection/helpers/mongoid_model_helpers.rb', line 7 def execute_query_to_models(result_array_mongoid_criteria) result_array_mongoid_criteria.map { |model| model } end |