Created
April 13, 2012 16:57
-
-
Save romikoops/2378343 to your computer and use it in GitHub Desktop.
Rspec configuration and acceptance test for quick integration with Social Networks
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
# -*- encoding : utf-8 -*- | |
require 'spec_helper' | |
OmniAuth.config.test_mode = true | |
OmniAuth.config.add_mock(:facebook, {:uid => '123545', | |
:info => { :email => '[email protected]', | |
:first_name => "First", | |
:last_name => "Last"} | |
}) | |
OmniAuth.config.add_mock(:vkontakte, {:uid => '123545', | |
:info => { :first_name => "First", | |
:last_name => "Last"} | |
}) | |
module IntegrationSpecHelper | |
def login_with_oauth(service = :facebook) | |
visit "/auth/#{service}" | |
end | |
end | |
RSpec.configure do |config| | |
config.include IntegrationSpecHelper | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment