Skip to content

Instantly share code, notes, and snippets.

@deathbob
Created June 23, 2011 21:43
Show Gist options
  • Select an option

  • Save deathbob/1043708 to your computer and use it in GitHub Desktop.

Select an option

Save deathbob/1043708 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe Users::OmniauthCallbacksController do
include Devise::TestHelpers
before :each do
@user = Factory.create(:user)
request.env["devise.mapping"] = Devise.mappings[:user]
end
describe 'auth from facebook' do
describe 'with valid procedures' do
it 'signs the user in' do
@controller.stubs('env').returns({"omniauth.auth" => {'extra' => {"user_hash" => {"email" => @user.email}}}})
get(:facebook)
response.should be_redirect
response.should redirect_to(root_path)
flash[:notice].should =~ /Successfully/
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment