Created
August 25, 2011 12:44
-
-
Save dpsk/1170568 to your computer and use it in GitHub Desktop.
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
module IntegrationSpecHelper | |
def login_with_oauth(service = :facebook) | |
visit "/auth/#{service}" | |
end | |
end | |
============================================================================ | |
RSpec.configure do |config| | |
config.include IntegrationSpecHelper, :type => :request | |
end | |
Capybara.default_host = 'http://example.org' | |
OmniAuth.config.test_mode = true | |
OmniAuth.config.add_mock(:facebook, { | |
:uid => '12345', | |
:nickname => 'dpsk' | |
}) | |
=========================================================================== | |
require 'spec_helper' | |
describe 'facebook' do | |
it "should login with facebook", :js => true do | |
visit "/auth/facebook" | |
visit '/' | |
page.should have_content("dpsk") | |
end | |
end | |
=========================================================================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment