/** @test */
 public function it_creates_repeated_as_two_inputs()
 {
     $repeatedForm = $this->formBuilder->plain();
     $repeated = new RepeatedType('password', 'repeated', $this->plainForm, []);
     $repeated->render();
     $this->assertEquals(2, count($repeated->getChildren()));
     $this->assertInstanceOf('Kris\\LaravelFormBuilder\\Fields\\InputType', $repeated->first);
     $this->assertInstanceOf('Kris\\LaravelFormBuilder\\Fields\\InputType', $repeated->second);
     $this->assertNull($repeated->third);
 }
    /** @test */
    public function it_creates_repeated_as_two_inputs()
    {
        $this->fieldExpetations('text', Mockery::any());
        $this->fieldExpetations('text', Mockery::any());
        $this->fieldExpetations('repeated', Mockery::any());
        $repeatedForm = $this->setupForm(new Form());
        // Child fields are initialized when constructing a repeated type
        // from plain form
        $this->container->shouldReceive('make')->once()->andReturn($this->plainForm);

        $repeated = new RepeatedType('password', 'repeated', $this->plainForm, []);

        $repeated->render();

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

        $this->assertInstanceOf('Kris\LaravelFormBuilder\Fields\InputType', $repeated->first);
        $this->assertInstanceOf('Kris\LaravelFormBuilder\Fields\InputType', $repeated->second);
        $this->assertNull($repeated->third);
    }