/** @test */
    public function it_creates_collection_with_child_form()
    {
        $form = clone $this->plainForm;
        $this->request->shouldReceive('old');

        $form->add('name', 'text')
            ->add('gender', 'choice', [
                'choices' => ['m' => 'male', 'f' => 'female']
            ])
             ->add('published', 'checkbox');

        $data = new \Illuminate\Support\Collection([
            ['name' => 'john doe', 'gender' => 'm'],
            ['name' => 'jane doe', 'gender' => 'f']
        ]);

        $options = [
            'type' => 'form',
            'data' => $data,
            'options' => [
                'class' => $form
            ]
        ];

        $this->fieldExpetations('collection', Mockery::any());

        $childFormCollection = new CollectionType('emails', 'collection', $this->plainForm, $options);

        $childFormCollection->render();

        $this->assertEquals(2, count($childFormCollection->getChildren()));
    }