Skip to content

Instantly share code, notes, and snippets.

@bamorim
Created September 8, 2013 02:05
Show Gist options
  • Save bamorim/6481251 to your computer and use it in GitHub Desktop.
Save bamorim/6481251 to your computer and use it in GitHub Desktop.
Unit testing OmniauthCallbacksController
require 'spec_helper'
describe Users::OmniauthCallbacksController do
let(:user) {FactoryGirl.create(:user)}
before do
request.env["devise.mapping"] = Devise.mappings[:user]
User.stubs(:find_or_create_with_omniauth).returns(user)
end
it "should set current_user to facebook user" do
get :facebook
@controller.current_user.should eq(user)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment