Skip to content

Instantly share code, notes, and snippets.

@richsage
Created June 9, 2011 10:27
Show Gist options
  • Save richsage/1016489 to your computer and use it in GitHub Desktop.
Save richsage/1016489 to your computer and use it in GitHub Desktop.
Behat, FOS FacebookBundle
Feature: Register with MyApp with a Facebook account
As a Facebook user
I want to register with MyApp
In order to do awesome stuff
Scenario: Susan Smith logs into MyApp
Given I am logged in as Susan Smith on Facebook
When I click sign in with facebook
Then I am asked to authorise the MyApp facebook app
And I should be redirected to the MyApp profile page
Scenario: John Smith chooses not to authorise MyApp
Give I am logged in as John Smith on Facebook
When I click sign in with facebook
And I refuse to authorise MyApp
Then I should be redirected to the MyApp home page
And I should see a message saying "To take part in MyApp you need to authorise our app"
Scenario: Frank Smith logs into MyApp
Given I am not logged in as Frank Smith on Facebook
When I click sign in with facebook
Then I am asked to sign in to facebook
And I sign into facebook as Frank Smith
And I am asked to authorise the MyApp facebook app
And I should be redirected to the MyApp profile page
@everzet
Copy link

everzet commented Jun 9, 2011

  1. use 2 spaces indentation instead - it will be far more readable;
  2. use no I should be redirected steps if you test with Mink - browsers redirect automatically and always!
  3. i would prefer to make stub service (in test environment) in this case to test authorization, cuz it's not the matter of "does facebook works correctly with your app", but "does your app works correctly with facebook auth API" instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment