Created
September 8, 2013 02:05
-
-
Save bamorim/6481251 to your computer and use it in GitHub Desktop.
Unit testing OmniauthCallbacksController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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