spec/integration/repository_spec.rb in rom-repository-1.0.0.beta1 vs spec/integration/repository_spec.rb in rom-repository-1.0.0.beta2

- old
+ new

@@ -93,9 +93,20 @@ expect(jane.labels.size).to be(2) expect(jane.labels[0].name).to eql('red') expect(jane.labels[1].name).to eql('blue') end + it 'loads children and its parents via wrap' do + posts = repo.posts.wrap_parent(author: repo.users) + + label = repo.labels.combine(many: { posts: posts }).first + + expect(label.name).to eql('red') + expect(label.posts.size).to be(1) + expect(label.posts[0].title).to eql('Hello From Jane') + expect(label.posts[0].author.name).to eql('Jane') + end + it 'loads a parent via custom fks' do post = repo.posts.combine(:author).where(title: 'Hello From Jane').one expect(post.title).to eql('Hello From Jane') expect(post.author.name).to eql('Jane')