2016-04-23 42 views
0

登録フォームをテストする必要がありますが、reCaptchaフィールドのテスト方法はわかりません。laravel 5 unit testing captcha

私はエラーを取得:ここ

HomeTest::testNewUserRegistration InvalidArgumentException: Nothing matched the filter [captcha] CSS query provided for [ http://localhost/auth/register] .

は私の現在のテストです:

私の形で
public function testNewUserRegistration() 
    { 
     $faker = Faker\Factory::create(); 
     $this->visit(route('auth.register')) 
      ->type($faker->firstNameMale, 'firstname') 
      ->type($faker->lastName, 'lastname') 
      ->type($faker->userName, 'username') 
      ->type($faker->email, 'email') 
      ->attach($faker->imageUrl(), 'avatar') 
      ->type($faker->password, 'password') 
      ->type($faker->password, 'password_confirmation') 
      ->check('terms') 

      ->check('captcha') 

      ->press('Envoyer') 
      ->seePageIs('/'); 
    } 

私がように私のキャプチャを宣言:

<div class="field {!! $errors->has('g-recaptcha-response') ? 'error' : '' !!}"> 
       {!! app('captcha')->display() !!} 
       {!! $errors->first('g-recaptcha-response', '<span class="ui text" style="color: #bf4d4b">:message</span>') !!} 
      </div> 

答えて