Skip to content

Instantly share code, notes, and snippets.

@wouterj
Created September 22, 2013 13:29
Show Gist options
  • Select an option

  • Save wouterj/6659907 to your computer and use it in GitHub Desktop.

Select an option

Save wouterj/6659907 to your computer and use it in GitHub Desktop.
<?php
// ...
class FeatureContext extends MinkContext
{
protected $guestsName;
// ...
/**
* @Given /I am a guest named "([^"]+)"/
*/
public function nameGuest($name)
{
$this->guestsName = $name;
}
/**
* @Given /I fill out the guest book form/
*/
public function fillGuestBookForm()
{
$this->fillField('name', $this->guestsName);
// ...
}
}
Feature: GuestBook
In order to track all of my visitors
As an admin
I want to give users the ability to sign my guestbook
Background:
Given I am a guest named "John Doe"
Scenario: With Valid Credentials
Given there are no guests
And I am on "guests/create"
And I fill out the guest book form
Then I should see "Guest Book"
And I should see "John Doe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment