

Easy Rails OAuth integration testing with Omniauth and Capybara - zapnap
http://blog.zerosum.org/2011/03/19/easy-rails-outh-integration-testing.html

======
idlewords
It's amusing that this post about some raft of dependencies that is supposed
to make testing easy, painless and fun opens with a mini-rant about an earlier
module that was supposed to make things super easy and fun, but ended up
causing the author pain.

This seems like a common Rails tradeoff (trading quick development time for
dependency chasing and complexity), except it's rarely presented as a
tradeoff.

~~~
JonnieCache
I have used the tool in question and recently abandoned it for the same setup
described in the article, I'm guessing for the same reasons he did.

Cucumber is only annoying if you don't need to use it. A lot of people who
didn't really need it were using it in the rails world, and recently they have
got sick of it.

If you have an actual business need for executable documentation like it
provides, then it is still excellent and not a headache.

------
hopeless
I recently started using Omniauth & Capybara like this. It seems to work
easily enough even for a relative testing novice like me.

------
ryanfitz
I know this would slow down your integration tests and complicate them, but
wouldn't you want to avoid mocking twitter this way to actually test that your
site is integrating properly with the service? Mocking obviously has its
place, but I'd avoid it if possible for end to end testing like this.

~~~
pbill
I have this challenge and I'm very interested in seeing how others solve this
without using mocks. For my tests, I have 5 tests that rely on Twitter logins.
Given that I run my tests ~10 times per day (on each commit), and other
developers run my tests on their commits, I would have number_of_developers *
commits_per_developer_per_day * 5 logins per day with a real twitter account.
My guess is that that would run afoul of twitter's policies.

I'd love to see a web based stubbing service that would let me test against
Twitter and especially Facebook without using real accounts on either.

~~~
ryanfitz
Facebook does offer test user accounts (with an api) exactly for these types
of scenarios <http://developers.facebook.com/docs/test_users>

I don't know if twitter offers anything similar.

~~~
pbill
I didn't know about these Facebook test accounts. Thanks for letting me know.
These will be very helpful.

