-
-
Save ashmoran/4575694 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
require_relative 'test_helper' | |
require 'rack/test' | |
require 'minitest/autorun' | |
require 'capybara' | |
require 'capybara/dsl' | |
include Capybara::DSL | |
def app | |
MyApp::Server | |
end | |
Capybara.app = app | |
OmniAuth.config.test_mode = true | |
OmniAuth.config.mock_auth[:github] = OmniAuth::AuthHash.new({ | |
:provider => 'github', | |
:uid => '123545', | |
:nickname => 'garethrees' | |
# etc. | |
}) |
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_relative '../integration_helper' | |
describe 'A User can sign in' do | |
include Rack::Test::Methods | |
before do | |
request.env["omniauth.auth"] = OmniAuth.config.mock_auth[:github] | |
end | |
specify 'guest user can create an account' do | |
visit '/' | |
click_link 'Sign in with GitHub' | |
assert # can find user | |
end | |
end |
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
ENV['RACK_ENV'] = 'test' | |
require_relative '../lib/myapp' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment