Mar 12, 2015
0
Level 2
Unexpected passing Behat functional test
Hello,
I'm just doing functional tests for the first time using L5, Homestead, Behat3 and the Behat Laravel 5 Extension.
My test is very simple and it is stored in features/example.feature:
Feature: Sample
In order to learn Behat
As a programmer
I need a simple url testing
Scenario: Registration
Given I am not logged in
When I go to the registration form
Then I will be automatically logged in
My FeatureContext.php contains the following functions:
/**
* @Given I am not logged in
*/
public function iAmNotLoggedIn()
{
Auth::guest();
}
/**
* @When I go to the registration form
*/
public function iGoToTheRegistrationForm()
{
$this->visit(url('my/url'));
}
/**
* @Then I will be automatically logged in
*/
public function iWillBeAutomaticallyLoggedIn()
{
Auth::check();
}
When I run behat, I expect the test to fail because the my/url url doesn't exists. However, it is all green...
Surely I'm doing something wrong, but I cannot find what. Can you give me some help?
Thank you very much,
Marco
Please or to participate in this conversation.