jrallison / authlogic_oauth

Authlogic OAuth is an extension of the Authlogic library to add OAuth support. OAuth can be used to allow users to login with their Twitter credentials.
authlogic-oauth.heroku.com
MIT License
165 stars 25 forks source link

How do you test your applications (which use authlogic_oauth) with cucumber? #7

Closed ravicious closed 9 years ago

ravicious commented 14 years ago

Hi,

How do you test your applications (which use authlogic_oauth) with cucumber?

I used to simply send a POST request to '/user_sessions' (to log in) or '/users' (to register), but it seems to be a bad idea, for example:

Given /^I am logged in as "([^\\"]*)"$/ do |username|
  # ...
  post '/user_sessions', :user_session => {:username => username, :password => "password"}
end

I found an another solution but it also looks a bit messy and author of this post didn't use authlogic.

How should I do it? (And sorry for my bad English)