Skip to content

Instantly share code, notes, and snippets.

@dpsk
Created August 25, 2011 12:44
Show Gist options
  • Save dpsk/1170568 to your computer and use it in GitHub Desktop.
Save dpsk/1170568 to your computer and use it in GitHub Desktop.
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