Skip to content

Commit

Permalink
add new spec to ensure documents_for_lazy_attribute works with inline…
Browse files Browse the repository at this point in the history
… hash
  • Loading branch information
marcosgz committed Aug 7, 2024
1 parent f3ad915 commit 48d733b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/esse/repository/lazy_document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@
Esse::LazyDocumentHeader::Document.new(header, source: { city_names: 'London' })
])
end

it 'returns an array of documents that match with the provided single hash' do
docs = repo.documents_for_lazy_attribute(:city_names, {id: '2', admin: true})
expect(docs).to eq([
Esse::LazyDocumentHeader.new(id: '2', admin: true).to_doc(city_names: 'London')
])
end
end

context 'when the attribute is defined and its result is hash with LazyDocumentHeader as key' do
Expand Down

0 comments on commit 48d733b

Please sign in to comment.