I'm working in Laravel 5.1, building tests to make sure that links behave as expected. I'm generating a table from a database, and each row will have a link with the same name "update".
How can I test multiple links like this since Laravel seems to require that you specify the name of a link? i.e. (from http://ift.tt/1du9DS3)
<a href="/about-us">About Us</a>
Now, let's write a test that clicks the link and asserts the user lands on the correct page:
public function testBasicExample()
{
$this->visit('/')
->click('About Us')
->seePageIs('/about-us');
}
Incidently, what kind of testing would this be? (I'm writing tests to check that key headings are present, links are present and point to the right place, data from the database is being produced as expected, etc.)
Aucun commentaire:
Enregistrer un commentaire