Integration testing OmniAuth with Cucumber?

283 views
Skip to first unread message

Steve Hoeksema

unread,
Nov 8, 2010, 5:52:26 PM11/8/10
to Devise
Hi all,

I'm trying to test integration with Facebook and Twitter using the
OmniAuth branch of Devise using Cucumber.

Here's what I have so far: https://gist.github.com/668416

In the past, I've tested third-party integration by mocking remote
responses with FakeWeb. What I want to do is return a series of
different JSON responses to test different results from Facebook (eg
missing email address, missing username)

However it looks like the Faraday or Devise test mode is abstracting
that away at a higher level.

Has anyone tried this or been able to get it working?

Cheers.

José Valim

unread,
Nov 9, 2010, 4:33:24 AM11/9/10
to Devise
If you are using OAuth2 (which is the case for facebook), Devise
indeed provides a few helpers. You can read more about them in the
wiki:

https://github.com/plataformatec/devise/wiki/OmniAuth:-Testing

Steve Hoeksema

unread,
Nov 9, 2010, 5:05:22 PM11/9/10
to Devise
Hi Jose,

I've tried following those steps (per my gist), but they're for RSpec.
Has anyone got this working for Cucumber?


Cheers

Sasha Koss

unread,
Nov 17, 2010, 3:57:38 AM11/17/10
to Devise
I have same problem too, but now make it work.

See https://gist.github.com/703165

breezeight

unread,
Dec 9, 2010, 5:17:17 PM12/9/10
to Devise
Sorry,
I'm quite new to cucumber, rspec and devise.
Can somebody explain what does the stub! method described here:
https://github.com/plataformatec/devise/wiki/OmniAuth:-Testing

I've never seen stub called with a block.

On Nov 17, 9:57 am, Sasha Koss <kossnoc...@gmail.com> wrote:
> I have same problem too, but now make it work.
>
> Seehttps://gist.github.com/703165
Reply all
Reply to author
Forward
0 new messages