0
votes

I'm fairly new to the BDD/Cucumber/Ruby field and I'm trying to help my team with writing new API tests in Cucumber/Ruby and one of the tests we need is a to check wether users can log in via Facebook.

So the behaviour looks like the following:

Scenario: As a user, when I connect with a verified facebook account for the first time, then I can sign up a new account
  Given I am a new user
  When `I connect with a verified facebook account`
  Then I can create a new account

I have step definitions for all steps apart from the one in backticks above.

Could you help?

1

1 Answers

1
votes

Try

Given I am a new user
And I have a verified facebook account
When I connect with my facebook account

so you can separate setting up the account, from using the account to connect to your application.

Then you have a number of ways to make this work. You could

  1. Use a real facebook account to connect
  2. Record the interaction using a facebook account using something like https://github.com/vcr/vcr, and use the recording
  3. Mock the facebook account

I think I'd probably go with 2.